Error notices in Pro admin panel, patch included
-
Hi,
I am currently evaluating Multilingual Press for a project and found a bug in the Pro version. Since there is no trac available, I’m pasting the patch here.
The notices are displayed when MPPro is installed with e.g. BBPress or BuddyPress and debugging is enabled. They look like this:
Notice: bbp_setup_current_user was called incorrectly. The current user is being initialized without using $wp->init(). Please see Debugging in WordPress for more information. (This message was added in version 2.3.) in /var/www/html/wordpress2/wp-includes/functions.php on line 3547 Notice: bp_setup_current_user was called incorrectly. The current user is being initialized without using $wp->init(). Please see Debugging in WordPress for more information. (This message was added in version 1.7.) in /var/www/html/wordpress2/wp-includes/functions.php on line 3547The Bogo multilingual plugin had the same problem and it looks like the author fixed it by delaying obtaining the current user id until after_setup_theme fired. Following that approach, I created this patch:
--- inc/pro/user-backend-language/Mlp_User_Backend_Language.php 2015-03-03 00:10:17.429693243 +0100 +++ patched/inc/pro/user-backend-language/Mlp_User_Backend_Language.php 2015-03-03 00:10:12.449693100 +0100 @@ -170,6 +170,9 @@ if ( ! $this->active ) return $locale; + if ( ! did_action( 'after_setup_theme' ) ) + return $locale; + return $this->get_user_language( get_current_user_id(), $locale ); }Best,
Markus
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘Error notices in Pro admin panel, patch included’ is closed to new replies.