Closed (won't fix)
Project:
Activity Stream
Version:
6.x-1.0
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
10 Aug 2010 at 01:11 UTC
Updated:
1 Sep 2012 at 02:40 UTC
I use and appreciate the Activity Stream module, but I'm playing with Search a bit, and noticed that the pager to show other pages of search results had vanished. I Googled up this page:
http://drupal.org/node/728734
That led me on a hunt for duplicate $pager variables, which led me to the Activity Stream module. I renamed the $pager variable in activitystream.module to $aspager. My search results pager is back, and the Activity Stream pager still works. Don't know if other people have run into this, but it worked for me.
Thanks for a great module!
Comments
Comment #1
akalsey commentedI don't see how changing $pager to $aspager would change anything, as the $pager variable is local to Activity Stream. What's happening here is Drupal's pager uses a query string variable to keep track of which pager was clicked if you have multiple pagers on a page. theme_pager uses a parameter called $element that a module developer can use as an ID to distinguish their pager from the others on the page.
Unfortunately, this ID is required to be unique, an integer, and sequential. The built-in pager is 0. In practice this ID is all but useless.
I set Activity Stream's to 1, and there's another module using 1, it's not unique, so neither pager will display.
I set Activity Stream to 5, and there's no modules setting 1-4, it's not sequential, so the pager will not display.
I set Activity Stream to "activitystream" and it's not an integer, so you'll get fatal errors.
If Drupal provided a registry of all IDs, that would work, since a module could just check and see what IDs are already in use and increment by one. Or, heck, Drupal could skip with the $element altogether and just keep track itself. Or probably best would be to allow text for IDs, so modules could use their names as the pager ID.
The end result is, there's really no way to use two modules on the same page that both have a pager. One or both pagers will not appear.
Comment #2
morbus iffWill reexamine if it ever shows up in Drupal 7.