Currently, views_content_views_panes_content_type_render() sets $view->get_total_rows to TRUE when the user has overridden the "More link" setting in the panel config. I think that this should not be done, because views_plugin_pager::pre_execute() already sets this property and has more conditions that determine if it should be set.

Specifically, the additional "Display 'more' link only if there is more content" setting is taken into account, something which CTools does not do. This setting is very useful for situations where you know that there is more content, because it saves an additional COUNT query.

views_plugin_pager::pre_execute() is always executed after views_content_views_panes_content_type_render(), so I think views_content_views_panes_content_type_render() should just perform $view->display_handler->set_option('use_more', TRUE) and leave setting $view->get_total_rows up to views_plugin_pager::pre_execute().

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Jorrit’s picture

Status: Active » Needs review
FileSize
1.02 KB

Please see the patch.

merlinofchaos’s picture

Not every pager sets that value, and you have to know a total to properly use the more link. For example, views_plugin_pager_some::pre_execute() does not set that, but you may need to know that data in that case.

What's missing is that several options have been added to Views' use_more usage since this was written, so things like use_more_always and use_more_text settings in Views are unknowns.

Chris Matthews’s picture

Issue summary: View changes
Status: Needs review » Needs work
Issue tags: +Needs reroll

The 6 year old patch to views_panes.inc does not apply to the latest ctools 7.x-1.x-dev and needs a reroll.

Checking patch views_content/plugins/content_types/views_panes.inc...
error: while searching for:
    }
    else {
      $view->display_handler->set_option('use_more', TRUE);
      // make sure the view runs the count query so we know whether or not the
      // more link applies.
      $view->get_total_rows = TRUE;
    }
  }

error: patch failed: views_content/plugins/content_types/views_panes.inc:225
error: views_content/plugins/content_types/views_panes.inc: patch does not apply
Jorrit’s picture

The attached patch is a rerolled patch of #1, but does not address the concerns mentioned in #2.

Jorrit’s picture

Issue tags: -Needs reroll

Regarding #2: I think I originally meant views_plugin_display::pre_execute() instead of views_plugin_pager::pre_execute().

Jorrit’s picture

Status: Needs work » Needs review