This bug is viewable even right here on drupal.org. To find it, simple search for anything that will result in pagination being displayed at the bottom of any page. Hover over "Page 2" and you will notice that the URL actually says page=1. This is because Page 2 is actually Page 0 + 1. Technically correct but logically incorrect. No regular joe is going to understand that page=1 is actually page 2. I had never noticed this before until someone said "Got to page X" so thinking I was going to be sneaky, I went to page X by typing in page=X which of course was going to be 1 page off. This bug has existed from 4.x and persists right through 7.x!!! Anyways, I posted a fix for it here:

http://drupal.org/node/73207#comment-961385

It's a simple 2 line fix and doesnt really need a .patch file but here it is anyways.

CommentFileSizeAuthor
pager.inc_.patch961 bytesLanceLight

Comments

kappaluppa’s picture

Cool! This is great...

drumm’s picture

Version: 5.x-dev » 7.x-dev
Status: Needs review » Closed (won't fix)

This would break everyone's bookmarks and URLs, which is unacceptable. It might be possible to change this in a major Drupal release, such as Drupal 7.0.

We do not sign code comments with names. The CVS logs and archives of these issue pages take care of attribution. Something like "Fix drupal's pagination." should either be left out or improved to something like "Make page number in URL match the UI."

LanceLight’s picture

Status: Closed (won't fix) » Reviewed & tested by the community
LanceLight’s picture

Version: 5.x-dev » 7.x-dev

So you wont fix a well known bug because it'll break some dudes bookmarks to the drupal.org website? Erm. Ok, whatever you say but I completely disagree with the mentality of lets not fix it because it might break someones bookmarks. As for bad url's/links within the site, that is easily fixed by running a db update during the upgrade process or if the update is called specifically from somewhere, I use a module to do it myself. If you need such an update script, I have one already since I have to do this on every single drupal site I encounter anyways and it doesnt take like all day to run either. 30 mins tops for sites that have a DB around 900GBs (thats the largest I've run it on so far, it took about 18 minutes). So I'd say lets not let this bug persist anymore, its really not that hard to fix up. Really, it isnt. I'd put it in cvs myself if I had commit access including the sql update query :P````

LanceLight’s picture

Version: 7.x-dev » 5.x-dev

mmm patch is for 5.x. even though the same bug exists in all versions of drupal.

killes@www.drop.org’s picture

Version: 7.x-dev » 5.x-dev
Status: Reviewed & tested by the community » Closed (works as designed)

The numbering scheme for paged pages was chosen deliberately.

drumm’s picture

The issue queue does send email, so I did get a copy of your original comment which you edited:

Yea, the fix works, but omg the guy has a comment in there that makes me look stupid! So lets call him names and ignore it like it doesnt exist. Good plan stan, thats how to run a good community. Yea lets see if he ever submits a patch again muhahaha. Retard.

If you read Drupal's code, you will see that my recommendations are consistent with Drupal's overall code quality.

I do appreciate your contributions, but have a problem with your attitude. I offered constructive criticism and you reply with insults and rants.

LanceLight’s picture

O really, and what would the reasoning be behind purposely using logically wrong page numbers? Maybe google should think about purposely using the wrong page numbers on their search pages. Makes perfect sense right? Search page 1 is actually the 2nd set of results? Sure, makes sense to me. And I have some gold mines for sale in Florida too. Phhhhh by design. Humor me some more please.

LanceLight’s picture

Status: Closed (works as designed) » Reviewed & tested by the community
beeradb’s picture

Status: Reviewed & tested by the community » Closed (won't fix)

Regardless of how strongly you feel about this, in most situations patches should not be RBTC'd by the person who created them.

greggles’s picture

Title: pager.inc creates wrong page numbers » Match url parameters to logical page numbers
Version: 5.x-dev » 7.x-dev
Status: Closed (won't fix) » Needs work

@LanceLight, I'll just say that you're dangerously close to getting blocked. Your attitude and tone is not tolerated beyond a warning, which you've already received more than once.

The code needs work and, since it's something that will "break" the url structure, it belongs in 7.x if it's going to get committed anywyere.

As a solution to the broken url problem we could easily provide a slightly modified pagination url like "?pager=1" instead of "?page=1" that way Drupal/Apache could detect the page= style url and 301 them to the new URL. We've done this several times in the past and fixed it via commented out .htaccess rules and the now removed legacy.module

michelle’s picture

I definitely agree this needs to go in 7 if anywhere as it will also break anything that relies on the way the numbers are set up now, such as advforum.

Michelle

damien tournoud’s picture

Status: Needs work » Closed (won't fix)

In most cases, the page number is not semantically significant. It is only an artifact of the way we want to display lists by splitting them in several pages.

Having "?page=1" instead of "?page=0" don't change anything because those pages are generally not meant to be used by humans: they are *not* permanent, so you can't refer another human to "page 3 of that list", because if the items in the list change the page can potentially look all different.

So this is a won't fix: there is no bug here. The case you are referring to (the page number in a list of messages ordered chronologically, like in a forum) is not the general case. Maybe Michelle could consider adding such a "feature" to advanced forum?

michelle’s picture

@Damien - Sorry, not really interested in re-implementing the core paging system in advforum just to shift the number by 1. :)

Michelle

lanny heidbreder’s picture

Title: Match url parameters to logical page numbers » Match URL parameters to logical page numbers
Version: 7.x-dev » 9.x-dev
Category: Bug report » Feature request
Issue summary: View changes
Status: Closed (won't fix) » Active

This is probably futile, but five and a half years after the last post, I thought I'd take a crack at begging and pleading for this for Drupal 9, since it's probably too late for Drupal 8.

The existing, won't-fixed behavior is really, really terrible, and it betrays the lack of concern for user experience and lack of taste that the Drupal community has struggled with for so long. But user experience is getting some attention these days, so maybe it's time to look at this again.

The address bar is as much a part of a site's user interface as what happens in the viewport. Maybe less technically savvy users don't look at URLs much, but more savvy users are Drupal users, too. And anyone who looks would be baffled and confused and wonder if something's wrong if they clicked "Next" on a pager and saw that the next page was ?page=1.

It's sloppy, it's amateurish, it's user-hostile, and for at least some people sometimes, it's a real usability issue. Any one of those should mean it needs to be fixed someday. I'd love to see it fixed in Drupal 8 since it's not released yet, but if that's impossible, it needs to make it into Drupal 9.

lanny heidbreder’s picture

Version: 9.x-dev » 8.x-dev

Moving this to 8.x-dev to get attention. I'm pretty sure people are going to yell at me and tell me D8 is way past the point where this is possible, but I thought I'd try, just in case.

lanny heidbreder’s picture

Status: Active » Closed (duplicate)
Related issues: +#1818040: Pager should start counting from 1, not 0