Skip to:
Content

Opened 4 years ago

Closed 4 years ago

#1400 closed defect (bug) (invalid)

bp_core_do_catch_uri not being called in custom component

Reported by: DJPaul Owned by:
Milestone: 1.2 Priority: major
Severity: Version:
Component: Keywords:
Cc:

Description

I think this is a priority issue on the add_action calls somewhere, not sure if it is my code or BuddyPress. This is on BP trunk 2152. I'm having an issue with a call to bp_core_load_template() from my customcomponent_setup_nav() which is hooked into plugins_loaded with pri 11.

bp_catch_uri() gets called OK but bp_core_do_catch_uri() is never called. Works fine for default BP components but not mine.

This is in my Achievements plugin, which requires 2 new theme template files. Rather than force people to move the files into /theme/whatever/ after the one-click plugin install, I successfully nagged Mr Peatling into adding a 'bp_located_template' filter. The aim is to utilise this so I can avoid having people move my theme template files (and allow them to override the default easily by copying the files into their theme folder).

So to allow me to continue development for the moment, I copied my 2 new theme/template files into /bp-default/ - and lo and behold, it did call bp_core_do_catch_uri(). Temp workaround but still weird.

Change History (3)

comment:1 DJPaul4 years ago

To clarify "...bp_core_load_template() from my customcomponent_setup_nav() which is hooked into plugins_loaded with pri 11":

1) customcomponent_setup_nav() creates the nav elements and, when the links are followed, calls my function -- dpa_screen() --- which decides which template file to load.
2) It is in the above function dpa_screen() which I call bp_core_load_template() in.

comment:2 DJPaul4 years ago

  • Milestone set to 1.2

comment:3 DJPaul4 years ago

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

Turns out that the setup nav functions need to be called priority 2:

add_action( 'wp', 'dpa_setup_nav', 2 );
add_action( 'admin_menu', 'dpa_setup_nav', 2 );

Note: See TracTickets for help on using tickets.