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()
.
Comment | File | Size | Author |
---|---|---|---|
#5 | ctools-get-total-rows-1858922-5.patch | 606 bytes | Jorrit |
Comments
Comment #1
Jorrit CreditAttribution: Jorrit commentedPlease see the patch.
Comment #2
merlinofchaos CreditAttribution: merlinofchaos commentedNot 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.
Comment #4
Chris Matthews CreditAttribution: Chris Matthews as a volunteer commentedThe 6 year old patch to views_panes.inc does not apply to the latest ctools 7.x-1.x-dev and needs a reroll.
Comment #5
Jorrit CreditAttribution: Jorrit at nCode for DOM Digital Online Media GmbH commentedThe attached patch is a rerolled patch of #1, but does not address the concerns mentioned in #2.
Comment #6
Jorrit CreditAttribution: Jorrit at nCode for DOM Digital Online Media GmbH commentedRegarding #2: I think I originally meant
views_plugin_display::pre_execute()
instead ofviews_plugin_pager::pre_execute()
.Comment #7
Jorrit CreditAttribution: Jorrit at nCode for DOM Digital Online Media GmbH commented