Closed (duplicate)
Project:
Drupal core
Version:
8.0.x-dev
Component:
base system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
16 Jun 2006 at 13:25 UTC
Updated:
1 Jul 2015 at 18:16 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
chx commentedPlease provide a patch per http://drupal.org/diffandpatch
Comment #2
magico commentedI do not know if this is really a bug. Let's assume a list of items that creates 3 pages, and we are in page 2 (it works as expected if we go to page 3).
The css class tree for the pager is:
- pager
- "pager-first active" (Go to first page)
- "pager-first active" (Go to previous page)
- "pager-list"
- "pager-first active" (Go to page 1)"
- "pager-current"
So there is a bug, that duplicates the CSS for two different things, disallowing the correct styling for "first", "previous". Check also "next" and "last" because the same problem happens.
Comment #3
Stefan Nagtegaal commentedThis is buggy behaviour in one of the theme_pager() or theme_pager_*() functions..
Priority critical.. I'll see if I have some time to backtrace where this is coming from today, or if someone else is willing todo it..
Feel free...
Comment #4
ChrisKennedy commentedThis would be good to fix but it doesn't break anything (http://drupal.org/node/45111 has priority guidelines) and should not block a release.
Comment #5
Nick Robillard commentedAfter some thought, I would call this a bug too.
Here's what i notice happening. When i'm on page 2, the "previous" & "first" links will have the same class because both take you to the SAME page. Same for when one is at the second to last page - the "next" and "last" links lead to the SAME page.
The logic is kind of twisted - the applied classes are based on where the link TAKES you, rather than what the link actually is. As far as I'm concerned, the "next" pager link, is ALWAYS a "next" link, no matter where it TAKES you. It should never be given the class "last", even if it technically takes me to the last page.
From a theming standpoint, it makes things quite difficult. At very least, there needs to be something unique between the 2 links. The theming aspect was definitely overlooked.
Comment #6
Nick Robillard commentedHere is my fix. There are 2 ways to apply it:
1) A patch.
2) A snippet to be included in template.php.
What this fix does
Removes the checks in "theme_pager_previous" and "theme_pager_next" for links that point to 1st or last page. Now "previous" and "next" links never get the classes "pager-first" or "pager-last".
Because the original dev intentionally made the pager behave like it did, I hesitate to call this a bug fix. Either way, this issue is now resolved. I've tested both methods on my installation.
EDIT: Oops - should have named the patch file "pager-69345-1152871.patch". (can't edit the attached files)
Comment #7
drummThis should not change in stable versions of Drupal. Themes are likely to rely on the current behavior. This might be changed the the development version of Drupal.
Comment #8
jody lynnComment #9
jhedstromI think the pager finally got a bit of cleanup work in the D8 cycle. See #1598886: Clean up pager theme functions and twig template conversion issues.