Skip to:
Content

BuddyPress.org

Opened 12 years ago

Closed 12 years ago

#4851 closed enhancement (duplicate)

Activity Loop args: scope 'favorites' overrides primary_id

Reported by: lucarosaldi's profile LucaRosaldi 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)

#1 @boonebgorges
12 years ago

  • Keywords needs-unit-tests added
  • Milestone changed from Awaiting Review to Future Release

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 the in param of bp_has_activities() along with all of your other arguments.

#2 @boonebgorges
12 years ago

  • Priority changed from normal to low
  • Severity changed from normal to minor

#3 @boonebgorges
12 years ago

  • Type changed from defect (bug) to enhancement

#4 @boonebgorges
12 years ago

  • Keywords needs-patch dev-feedback needs-unit-tests removed
  • Milestone Future Release deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Closing in favor of #4872

Note: See TracTickets for help on using tickets.