Opened 15 years ago
Closed 15 years ago
#2070 closed defect (bug) (fixed)
Mulitple Custom Activity Loops
Reported by: | lofish | Owned by: | |
---|---|---|---|
Milestone: | 1.5 | Priority: | major |
Severity: | Version: | ||
Component: | Activity | Keywords: | |
Cc: |
Description
If you run through a custom activity loop in a plugin specifying specific fields such as user_id its output will be influenced by another activity loop executed elsewhere on the page.
e.g. bp_has_activities('user_id='.bp_loggedin_user_id().'&max=10&scope=friends') will show a different users activity if you view another persons profile activity (so user_id is effectively overwritten).
There should probably be a reset_activity_loop function or similar that allows for more than one custom loop to be invoked in the same space. Not sure if this extends to other custom loops.
Change History (6)
#2
@
15 years ago
Sorry folks, the groups issue was down to my misunderstanding of the code. With the correct parameters it works correctly for my needs.
The activity loop issue I think I have traced to this conditional:
if ( $user_id = ( !empty( $bp->displayed_user->id ) ) ? $bp->displayed_user->id : $bp->loggedin_user->id )
If you pass in a user_id it will still get overwritten by this line, so I would think there should be a check beforehand to make sure the user_id isn't already set as a parameter.
#3
@
15 years ago
- Component set to Activity
Yes, this looks like a bug in the code, it is not checking for an existing user_id parameter.
Just noticed similar behaviour within a custom groups loop. Get a full group list except where I visit a specific group, whereupon the list only shows the single group.