Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
* Create a view with a pager and make sure the results span multiple pages
* Create a new PHP filter handler whose code is:
return TRUE;
* Run the view: no results will show on the page, but the pager is still showing as if all results were there.
The PHP filter handler should adjust the pager based on the filtered results.
Comments
Comment #1
infojunkie CreditAttribution: infojunkie commentedComment #2
infojunkie CreditAttribution: infojunkie commentedCommitted to latest dev. To be ported to D7 - which will not be straightforward because the code is different.
The idea of the fix is to create a pager helper object, stored in the view, that does the following:
* On pre_execute, instruct the view to retrieve all results instead of paged results
* On post_execute, re-paginate the view
The various PHP handlers flag their need for this pager via the
$view->use_pager_helper
flag, that is processed by views_php.module'shook_views_pre_execute
.Comment #3
lquessenberry CreditAttribution: lquessenberry commentedI am getting the same results in Drupal 7. I am not sure what to do to fix it. Has there been anything done to fix this in D7?
Comment #4
infojunkie CreditAttribution: infojunkie commentedNo, I've dropped out of maintaining Views PHP a long time ago. I doubt I can look at it again. Sorry!
Comment #5
lquessenberry CreditAttribution: lquessenberry commentedDo you recall if anyone ever ported this to D7 and just didn't update this thread?
Comment #6
infojunkie CreditAttribution: infojunkie commentedI doubt it - but I see there's a new module maintainer, maybe you'd like to contact them.