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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

PieterDC created an issue. See original summary.

PieterDC’s picture

Assigned: PieterDC » Unassigned
Status: Active » Needs review
Related issues: +#3045861: Add SEO Improvements
FileSize
606 bytes

  • rembrandx committed 91fe06c on 5.x
    Issue #3183006 by PieterDC: '\''Last'\'' link in HTML head always...

  • rembrandx committed 7028a3c on 6.x
    Issue #3183006 by PieterDC: '\''Last'\'' link in HTML head always...
rembrandx’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.