Opened 13 years ago
Closed 13 years ago
#3679 closed enhancement (fixed)
Multiple loops and pagination variable collision
Reported by: | r-a-y | Owned by: | |
---|---|---|---|
Milestone: | 1.6 | Priority: | normal |
Severity: | normal | Version: | 1.2 |
Component: | Core | Keywords: | has-patch |
Cc: | anointed |
Description
If you attempt to use multiple loops of the same component with pagination, the loops will not be independent of one another.
One way to work around this is to introduce a new parameter that we can set in the loop.
Then, the constructor that populates the loop will use this parameter as the query arg in pagination_links().
I've attached a patch detailing how this might work with the members loop.
The hope is that this approach will be used for all BP loops.
Attachments (6)
Change History (18)
#3
@
13 years ago
Nevermind. I just looked closer. bp_rewind_members() wouldn't do anything for this.
#4
@
13 years ago
Looks good, go ahead and patch for the other loops, please. Only thing I'd change is adding a default value to that new class constructor argument, for backpat.
#7
@
13 years ago
- Keywords needs-refresh added
The approach in this patch is fine, but we do need a refresh that will give a default value, as DJPaul suggested. r-a-y, can you do that for us? Can still squeeze this into 1.6, as there shouldn't be any other backpat issues and it's a straightforward enhancement.
#8
@
13 years ago
- Milestone changed from 1.6 to Future Release
It's getting late to squeeze this in for 1.6. It'd be great to do the same for all of the loops, not just members. Groups, Activity, etc...
Moving to Future Release; feel free to patch and move back to 1.6. Boone/Paul - if a good patch comes around, commit it asap so we can test it out.
#9
@
13 years ago
- Keywords needs-refresh removed
Refreshed original patch, and patched other loops with pagination, with forums being the exception. I went a la carte to so one can craft their ideal pagination variable collision prevention scenario.
I also noticed that in the template classes, we're inconsistent with PHP 4 contructors, or lack thereof. Three of the five I patched have PHP 4 constructors. Are these still needed, or should we start cleaning them out?
So if you use a default members loop and you want another loop independent of the current one, you could use something like: