http://drupaldocs.org/api/head/function/theme_pager and http://drupaldocs.org/api/head/function/pager_query both mention the $element parameter:
« $element An optional integer to distinguish between multiple pagers on one page. »

However, when I give it, lets say 12, then instead of the expected URL http://example.com/url?page=12,1 I see
http://example.com/url?page=0,0,0,0,0,0,0,0,0,0,0,0,1, the 0 appears twelve times.

Comments

markus_petrux’s picture

Good catch. It looks like pager_load_array should return elements in $new_array only for elements set in (say) $pager_page_array ?

markus_petrux’s picture

Status: Active » Needs review
StatusFileSize
new375 bytes

???

Bèr Kessels’s picture

Status: Needs review » Needs work

it fixes only half of the issue.
We now see ?page=0,1 but still not the expected ?page=12,1 (in case I gave $element arg. as 12)

Bèr

markus_petrux’s picture

The values for the var $page are page numbers, not the element, which is the position the internal pager array.

The patch seemed to work here. :-?

Bèr Kessels’s picture

Previously the argucment $element was
« An optional integer to distinguish between multiple pagers on one page »
Which means that if i do:
pager_query($query, 10, 12) and theme('pager', NULL, 10, 12);, i have a pager with a unique pager ID of 12.

That means that by calling that the pager 12, I can identify it from other pagers on that same page. (like a pager in a block, or the pager for comments under a node).

It is not used very often, because hardly anyone prints more then one pager on a page. but still, he option is there, and therefore should work as expected.

markus_petrux’s picture

Status: Needs work » Needs review
StatusFileSize
new2.14 KB

What about this one?

It provides an array to map $page_id to $element. Where $page_id can be anything and $element is always a zero based pointer to the internal $pager arrays.

markus_petrux’s picture

StatusFileSize
new2.02 KB

Sorry, previous patch had a couple of debug statements in place.

If too complex, this could also be considered a bug on the calling process side. Why would you use non-continuous zero based pager ids? maybe

flk’s picture

StatusFileSize
new2.22 KB

rerolled against head

drumm’s picture

Version: x.y.z » 6.x-dev
Category: bug » task

The existing behavior seems to work and is intended. This patch looks like an improvement, but we don't need to change URLs for Drupal 5.0.

zigma’s picture

Are we planning to fix it in 5.x?

On another note. Pager does not seem to take care of fragments in the link. This breaks pager feature when i have tabs where each tab is distinguished by fragment identifier.

The pager link ignores fragment identifier and therefore always sends me to first tab.

Any resolution?

bdragon’s picture

Status: Needs review » Needs work

Autopatch Results:
(Stripping trailing CRs from patch.)
patching file includes/pager.inc
Hunk #3 succeeded at 108 (offset 1 line).
Hunk #4 FAILED at 117.
1 out of 4 hunks FAILED -- saving rejects to file includes/pager.inc.rej

dpearcefl’s picture

Is there any interest in this issue any longer?

dpearcefl’s picture

Is there any interest in this this issue any more?

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.