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.
When using a pager on a view and manually going to a page with a higher page number than the maximum page I expect views to return an empty page or some kind of error. Instead views currently ignores the page number and shows me the first page. This makes it very hard to in some situations figure out that the page number requested doesn't exist.
I would suggest to change this so that the page number is never ignored and if it's too high then an empty page is shown.
I attach the simplest patch possible to solve this - a nicer patch that doesn't waste a database query might be better.
Comment | File | Size | Author |
---|---|---|---|
views_remove_pager_total_check.patch | 611 bytes | voxpelli | |
Comments
Comment #1
Letharion CreditAttribution: Letharion commentedComment #2
merlinofchaos CreditAttribution: merlinofchaos commentedViews is supposed to conform to core's handling in this case. Actually it doesn't, but neither does yours.
Core's handling shows the last page if you go too high. So that's what we should do as well.
Comment #3
esmerel CreditAttribution: esmerel commentedComment #4
MustangGB CreditAttribution: MustangGB commented