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.
Problem/Motivation
Related to pagers, the rocketship_seo module prints a link to the last page that is 1 page too far. Causing someone, like the Google bot, to follow that and to hit a page with no actual results.
Steps to reproduce
Surf to a webpage with a pager and inspect the source code.
Notice the href value at <link rel="last" href="
ends with a page number that is 1 higher than the actual last page.
Proposed resolution
Follow similar logic to what Pager->setCurrentPage() has:
$this->currentPage = max(0, min($currentPage, $this->getTotalPages() - 1));
User interface changes
None.
API changes
None.
Data model changes
None.
Comment | File | Size | Author |
---|---|---|---|
#2 | rocketship_seo-last_pager_link-3183006-2.patch | 606 bytes | PieterDC |
Comments
Comment #2
PieterDCComment #5
rembrandx CreditAttribution: rembrandx at Dropsolid commented