Skip to:
Content

BuddyPress.org

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#7562 closed defect (bug) (fixed)

Activity's friends component filter fails since 4.8

Reported by: imath's profile imath Owned by: r-a-y's profile r-a-y
Milestone: 2.8.3 Priority: normal
Severity: normal Version: 2.8.0
Component: Templates Keywords: has-patch dev-feedback
Cc:

Description

Hi everyone,

I've just met bp_activity_get_actions_for_context(). This function was introduced in 4.8 and according to the inline comment targets to get a flat list of activity actions compatible with a given context.

The problem of it happens when an action is a comma separated value like 'friendship_accepted,friendship_created' (the value of the Activity friends component filter). In this case the action parameter of the query string is not build, and you get the entire activity stream instead of only the friends component activities. So it's a regression.

I think we should simply handle comma separated values as filters more generally. We only use them for the friends component but it can make sense to create a new custom filter with more than one activity type.

That's why i'm suggesting to edit the bp-templates/bp-legacy/buddypress-functions.php instead of the activity context function.

Attachments (1)

7562.patch (1.0 KB) - added by imath 8 years ago.

Download all attachments as: .zip

Change History (6)

@imath
8 years ago

This ticket was mentioned in Slack in #buddypress by r-a-y. View the logs.


8 years ago

#2 @r-a-y
8 years ago

  • Owner set to r-a-y
  • Resolution set to fixed
  • Status changed from new to closed

In 11650:

bp-legacy: After r11356, fix issues with filtering multiple activity actions.

In #4062, we started to validate activity actions against a given context.
However, we did not take into account the validation of multiple activity
actions during AJAX activity filtering. This broke the "Friendships"
dropdown filter since it uses a comma-separated action value of
friendship_accepted,friendship_created.

This commit remedies this by accepting multiple activity actions and
cross-referencing it against the registered activity actions for the AJAX
activity querystring.

Props imath.

Fixes #7562 (2.8-branch).

#3 @r-a-y
8 years ago

In 11651:

bp-legacy: After r11356, fix issues with filtering multiple activity actions.

In #4062, we started to validate activity actions against a given context.
However, we did not take into account the validation of multiple activity
actions during AJAX activity filtering. This broke the "Friendships"
dropdown filter since it uses a comma-separated action value of
friendship_accepted,friendship_created.

This commit remedies this by accepting multiple activity actions and
cross-referencing it against the registered activity actions for the AJAX
activity querystring.

Props imath.

Fixes #7562 (trunk).

#4 follow-up: @r-a-y
8 years ago

Thanks for finding this bug, @imath!

#5 in reply to: ↑ 4 @imath
8 years ago

Replying to r-a-y:

Thanks for finding this bug, @imath!

You're very welcome @r-a-y :)

Note: See TracTickets for help on using tickets.