#2176 closed defect (bug) (fixed)
BuddyPress: BBP_BuddyPress_Activity::register_activity_actions() not running early enough
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | 2.3 | Priority: | normal |
Severity: | normal | Version: | 2.2 |
Component: | Extend - BuddyPress | Keywords: | has-patch |
Cc: |
Description
Synopsis
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:
https://buddypress.trac.wordpress.org/ticket/4786
Why?
bbPress is not registering its activity actions early enough.
The BBP_BuddyPress_Activity
class runs on bp_init
at priority 10:
https://bbpress.trac.wordpress.org/browser/tags/2.2.3/includes/extend/buddypress/loader.php#L137
While in that same class, it tries to register its activity actions:
https://bbpress.trac.wordpress.org/browser/tags/2.2.3/includes/extend/buddypress/activity.php#L132
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)
Change History (6)
#3
@
12 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.
#5
@
12 years ago
Hi JJJ,
Didn't get an email about this!
Re:
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.
Are the additional activity stream actions really necessary? Won't that fragment the activity stream actions?