Skip to:

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#2176 closed defect (fixed)

BuddyPress: BBP_BuddyPress_Activity::register_activity_actions() not running early enough

Reported by: r-a-y Owned by:
Milestone: 2.3 Priority: normal
Severity: normal Version: 2.2
Component: Extend - BuddyPress Keywords: has-patch



BuddyPress 1.6 introduced the "Activity" dashboard to edit activity stream items.

When editing a bbPress forum activity item, the activity type changes from 'bbp_reply_create' / 'bbp_topic_create' to something else.

This creates this problem:


bbPress is not registering its activity actions early enough.

The BBP_BuddyPress_Activity class runs on bp_init at priority 10:

While in that same class, it tries to register its activity actions:

The 'bp_register_activity_actions' hook runs at bp_init at priority 8 so it's a chicken-before-egg scenario.

Proposed solution

Move the setup_components() hook to run at priority 7:

// Setup the components
add_action( 'bp_init', array( $this, 'setup_components' ), 7 );

In the attached patch, I've also registered some additional activity actions for the groups component.

Not sure what the consequences are with moving the hook a little earlier, but this was the easiest fix I could find.

Attachments (1)

2176.01.patch (1.9 KB) - added by r-a-y 8 years ago.

Download all attachments as: .zip

Change History (6)

8 years ago

#1 @johnjamesjacoby
8 years ago

Are the additional activity stream actions really necessary? Won't that create two duplicate activity stream items?

Version 0, edited 8 years ago by johnjamesjacoby (next)

#2 @johnjamesjacoby
8 years ago

(In [4719]) Whitespace cleanup in BuddyPress activity.php. See #2176.

#3 @johnjamesjacoby
8 years ago

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

(In [4720]) In BuddyPress's loader, setup components in priority 7, to get them in before activity actions are registered. Props r-a-y. Fixes #2176.

#4 @johnjamesjacoby
8 years ago

  • Milestone changed from Awaiting Review to 2.3

#5 @r-a-y
8 years ago


Didn't get an email about this!


Are the additional activity stream actions really necessary? Won't that fragment the activity stream actions?

It isn't necessary for this ticket, but it might be better to add them anyway since bbP adds its own activity entries into the groups component. I'll leave it to your discretion.

Note: See TracTickets for help on using tickets.