Skip to content

[UX] Make the GET page variable consistent with the real page number #7166

Description

@yorkshire-pudding

Description of the need

From: https://www.drupal.org/project/drupal/issues/385270
Backdrop's Drupal's pagination is a bit geeky: it starts from 0 instead of 1. If we are on the first page and we click on the number 2 (or on the "next" link) in the navigation bar, we're displaying the second page, but the $_GET['page'] variable on the url is ?page=1.

$_GET['page'] variable is one lower than the real page number marked in the navigation bar. For most people, I think that it's a bit disconcerting and not user-friendly ergonomics.

Proposed solution

The page parameter in the URL will match the active number on the pager link

Alternatives that have been considered

None

Is there a Drupal or Backdrop contributed module that accomplishes this?
No

Additional information

This was raised as a D7 issue but never merged:
https://www.drupal.org/project/drupal/issues/385270

There is a patch by azovsky at:
https://www.drupal.org/project/drupal/issues/385270#comment-11982646

While the line numbers are different, the changes can apply to Backdrop's code mostly the same (small change to accommodate newer PHP versions). I also needed to modify the tests to reflect the page numbers now delivered.

Draft of feature description for Press Release (1 paragraph at most)

Backdrop's pagers will now show the same page in the URL as is shown in the pager link.


PR: backdrop/backdrop#5292

Metadata

Metadata

No fields configured for Feature.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions