gantry / gantry5

:rocket: Next Generation Template / Theme Framework
http://gantry.org
1.03k stars 203 forks source link

Fatal Error in Gantry 5.3.1 with Buddypress #1441

Closed AlwynBarry closed 8 years ago

AlwynBarry commented 8 years ago

Error reported when WP_DEBUG true:

Fatal error: Call to undefined function Gantry\WordPress\Assignments\is_plugin_active() in /home/sites/streetbaptist.co.uk/public_html/wp-content/plugins/gantry5/src/classes/Gantry/WordPress/Integration/BuddyPress/Assignments.php on line 33

Works fine when Buddypress plugin is disabled ... but hardly useful in a BuddyPress site!!

w00fz commented 8 years ago

Can you edit that file /home/sites/streetbaptist.co.uk/public_html/wp-content/plugins/gantry5/src/classes/Gantry/WordPress/Integration/BuddyPress/Assignments.php and on line 33 change is_plugin_active with \is_plugin_active (note the back slash at the beginning). Does it solve the issue?

nikola3244 commented 8 years ago

Also, this this line could maybe make a problem too: https://github.com/gantry/gantry5/blob/develop/src/platforms/wordpress/WordPress/Integration/BuddyPress/Assignments.php#L212

nikola3244 commented 8 years ago

(not related to this particular issue)

w00fz commented 8 years ago

Probably also the line above? \buddypress(). I don't have a setup with buddypress, can anyone test?

nikola3244 commented 8 years ago

Me neither, I just took a quick look at the code

AlwynBarry commented 8 years ago

Changed line 33 to: $this->_active = \is_plugin_active('buddypress/bp-loader.php');

still:

Fatal error: Call to undefined function is_plugin_active() in /home/sites/streetbaptist.co.uk/public_html/wp-content/plugins/gantry5/src/classes/Gantry/WordPress/Integration/BuddyPress/Assignments.php on line 33 
w00fz commented 8 years ago

You might need to clear cache also

AlwynBarry commented 8 years ago

Cleared the cache before the test ... already had the cache plugin turned off, but cleared that anyway, and also cleared the theme cache (Rockettheme Isotope).

WP-Cache (0KB)

    0 Cached Pages
    0 Expired Pages

WP-Super-Cache (0KB)

    0 Cached Pages
    0 Expired Pages
AlwynBarry commented 8 years ago

Ok, so adding: include_once( ABSPATH . 'wp-admin/includes/plugin.php' );

as directed in: https://developer.wordpress.org/reference/functions/is_plugin_active/

sorts the problem. But this might just be a 'quick hack' solution. I don't know the code tree and so can't see where this include should come!

w00fz commented 8 years ago

That's actually what I just tried as well. I'm just not sure why it stopped working, definitely requires further investigation.

Thanks

newkind commented 8 years ago

That's very odd, I have all debugs enabled and all was working fine for me.