Skip to:
Content

BuddyPress.org

Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#2473 closed defect (bug) (fixed)

Changing priority of bp_init and introducing bp_loaded causing issues with existing issues

Reported by: sbrajesh's profile sbrajesh Owned by:
Milestone: 1.2.6 Priority: major
Severity: Version:
Component: Core Keywords:
Cc:

Description

hi JJJ,
You remember you had introduce bp_init as the future proof hook in buddypress 1.2.

As I see now, a new hook bp_loaded is introduced and in the favor of bp_loaded the "setup_root_component" is now not called with plugins_loaded but with bp_loaded action.

It is causing issues when an existing plugin uses bp_init hook and adds the navigation item.

The problem is "bp_core_new_nav_item" checks for the root component, but the root component will not be populated until "bp_setup_root_components" action executes, so an error is generated as passing null instead of array on bp-core.php line 315.

The problem is, if it is kept as it is now, It is going to break almost all buddypress plugins which used "bp_init" action to create new nav items.

Rather than resolving this issue,I am more interested in hearing form a core developer about any future proof way to create new plugins and not break them with every Buddypress release. As of buddypress 1.2, "bp_init" was introduced as the future proof way but it no more seems to be of any effect other than being used for loading the plugins and making it buddypress aware and why would anyone need it anymore if the bp_loaded action is available ?

Thanks
Brajesh

Change History (3)

#1 in reply to: ↑ description @sbrajesh
14 years ago

the title should be
"Changing priority of bp_init and introducing bp_loaded causing issues with existing plugins which used bp_init to add navigation"

#2 @sbrajesh
14 years ago

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

seems to be corrected in r3105, had not remembered Jeff's ticket #2325 which had something similar.closing it for now.

#3 @johnjamesjacoby
14 years ago

This one and #2325 are particularly tricky because people have been using bp_init in different ways. Previously there was nothing stopping us from using bp_init and loading code before the core components.

I have several plugins that broke with this fix, but there isn't a way around it because it was partially implemented previously.

Note: See TracTickets for help on using tickets.