Opened 12 years ago
Closed 12 years ago
#4851 closed enhancement (duplicate)
Activity Loop args: scope 'favorites' overrides primary_id
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | low | |
Severity: | minor | Version: | 1.7 |
Component: | Activity | Keywords: | |
Cc: |
Description
Hi,
I wanted to show the favorites activity for a specific group, so I used the following args for the bp_has_activities() loop:
$args = array( 'primary_id' => [group_id], 'object' => 'groups', 'scope' => 'favorites' );
Obviously, the [group_id] is the actual group id.
The result is: the loop shows the favorites activity for the current user, but sitewide, not for the current group only.
If I use any other scope (e.g. 'just-me'), instead, it returns the activity only for the group specified with the primary_id.
Change History (4)
Note: See
TracTickets for help on using
tickets.
Yes, this is a side effect of the way
bp_has_activities()
work - if you are using a 'favorites' scope, the filters are bypassed.It'd be nice to fix this to work more gracefully at some point in the future, but it'd require massive refactoring of how activity filters work.
In the meantime, here's a possible workaround: First, use
bp_activity_get_user_favorites()
to get an array of activity ids. Then, pass these ids to thein
param ofbp_has_activities()
along with all of your other arguments.