buddypress / bp-classic

BuddyPress backward compatibility plugin to be able to carry on using it the old way!
GNU General Public License v2.0
0 stars 1 forks source link

PHP Notice: Undefined index: wp_theme_directories in bp-classic/class-bp-classic.php:251 #23

Closed dd32 closed 1 year ago

dd32 commented 1 year ago

This appears to be an issue when the plugin is activated on a network.

WordPress doesn't fill the $wp_theme_directories until between mu-plugins and plugins, but network activated plugins are loaded before mu-plugins:

https://github.com/WordPress/wordpress-develop/blob/f7fbd0c25f6824f7259dbca47b38c6569901baf5/src/wp-settings.php#L456

Order:

 - Network plugins included
 - Mu plugins included
 - $wp_theme_directories initialized
 - plugins included
dd32 commented 1 year ago

FWIW This might also be considered a buddypress bug - in that it's not waiting until plugins_loaded to register it's own stuff.. including the themes.

imath commented 1 year ago

Hi @dd32

Thanks a lot for your feedback, I guess the bp_after_setup_actions hook was a wrong pick 😬. I'll test with the BP Hook corresponding to plugins_loaded 👍.

About booting BuddyPress at plugins_loaded I believe we have a filter to make this happen. It probably should be the default behavior I agree. I'll look at it for next major release ☺️

dcavins commented 1 year ago

Thanks for the useful feedback!