Changes:

  1. In pager_query, $pager_page_array is reinitialized with every call to pager_query. This could cause problems, as other users of $pager_page_array assume it has been sanitized, which is not the case when using multiple $element indexes (old sanity checking would be undone with each call.) Fix that by only setting up the array once.
  2. Allow counting from the end by using negative indexes. (-1 = last page, -2 = second to last, etc..)
  3. Substitute -1 for 'last' when setting up $pager_page_array.

Thoughts?

Comments

bdragon’s picture

Version: x.y.z » 6.x-dev
Assigned: Unassigned » bdragon

Patch still applies fine to HEAD.
Reclassifying, minor feature requests are definately 6.x fodder. ;)

bdragon’s picture

Version: 6.x-dev » 7.x-dev
StatusFileSize
new1.74 KB

Still applies (no fuzz even..), but rerolled anyway with -up.

Since 6.x is feature frozen, moving to 7.x.

bdragon’s picture

Status: Needs review » Needs work

[17:26] Bdragon: ($v=='last') that's a code style error
[17:26] Bdragon: (int)$pager_total[ that's another one
[17:26] dmitrig01: Yeah, it's an old patch from before I knew better...
[17:26] Bdragon: ((int)$pager_total[$element]) - 1)); tha'ts another one
[17:27] dmitrig01: how (int)$page_total[ is a code style error.
[17:27] according to the coder module " l() already contains a check_plain() call by default"
[17:27] thanks, coder module!
[17:27] dmitrig01: You want to cnw it, or should I?
[17:27] chx: shouldn't there be a space after (int)?
[17:27] coder.module rocks. ;)
[17:27] yeah, I <3 coder.module...
[17:27] coder.module rocks so hard
[17:27] so hard
[17:27] dmitrig01: for casts I prefer not
[17:27] Bdragon: I'll give you the pleasure of CNWing your own patch :D

bdragon’s picture

ok, obviously the nicks got stripped there XD..

Anyway, this is CNW because there were a bunch of code style problems...

lilou’s picture

Category: feature » bug
Status: Needs work » Needs review
StatusFileSize
new1.75 KB

Reroll + code style according to #3.

Anonymous’s picture

Status: Needs review » Needs work

The last submitted patch failed testing.

Crell’s picture

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

pager_query() is no more, so this issue is no longer applicable.

Whether or not it matters for D6, I defer to Gabor.

Status: Needs work » Closed (outdated)

Automatically closed because Drupal 6 is no longer supported. If the issue verifiably applies to later versions, please reopen with details and update the version.