Skip to:
Content

BuddyPress.org

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#8485 closed enhancement (fixed)

Incorrect number of parameters passed to the filter 'bp_get_activity_content_body' in BP Nouveau template

Reported by: sbrajesh's profile sbrajesh Owned by: imath's profile imath
Milestone: 9.0.0 Priority: normal
Severity: normal Version:
Component: Core Keywords: has-patch
Cc:

Description

The filter 'bp_get_activity_content_body' is being created at many places in BuddyPress.

All the instances pass 2 parameters, the content and the activity object.

There are 2 places where only one parameter is passed(content).

It is in bp-nouveau/includes/activity/ajax.php line 313

	/** This filter is documented in bp-activity/bp-activity-template.php */
	$content = apply_filters( 'bp_get_activity_content_body', $activity->content );

which should be

	/** This filter is documented in bp-activity/bp-activity-template.php */
	$content = apply_filters( 'bp_get_activity_content_body', $activity->content, $activity );


Another instance is in bp-default theme. Since the bp-default was deprectade long ago, we may ignore that.

Please find a patch attached for the same.

Attachments (1)

8485.diff​ (700 bytes) - added by sbrajesh 3 years ago.

Download all attachments as: .zip

Change History (6)

@sbrajesh
3 years ago

#1 @imath
3 years ago

  • Milestone changed from Awaiting Review to 8.1.0

Good catch! Thanks for your report and patch πŸ‘Œ. Let’s include it in next minor release.

#2 @sbrajesh
3 years ago

Thank you. That would be nice to have.

#3 @imath
3 years ago

In 12972:

BP Nouveau: apply the activity content filter the right way

Inside the BP Nouveau Template pack, the bp_nouveau_ajax_get_single_activity_content() function was applying the 'bp_get_activity_content_body' filter using the wrong function and wasn't passing the second parameter of the filter:

  • Instead of using apply_filters() it should use apply_filters_ref_array().
  • The filter parameters should also include the Activity object passed by reference.

Props sbrajesh

See #8485 (trunk)

#4 @imath
3 years ago

  • Owner set to imath
  • Resolution set to fixed
  • Status changed from new to closed

In 12973:

BP Nouveau: apply the activity content filter the right way

Inside the BP Nouveau Template pack, the bp_nouveau_ajax_get_single_activity_content() function was applying the 'bp_get_activity_content_body' filter using the wrong function and wasn't passing the second parameter of the filter:

  • Instead of using apply_filters() it should use apply_filters_ref_array().
  • The filter parameters should also include the Activity object passed by reference.

Props sbrajesh

Fixes #8485 (branch 8.0)

#5 @imath
3 years ago

  • Milestone changed from 8.1.0 to 9.0.0

Ticket retargeted after milestone deleted

Note: See TracTickets for help on using tickets.