WordPress.org

Ready to get started?Download WordPress

Forums

WP Native Dashboard
[resolved] Reason for 3.6 add_menu() error and quickfix (9 posts)

  1. Ov3rfly
    Member
    Posted 11 months ago #

    Many have see this error after updating to WordPress 3.6:

    Fatal error: Call to a member function add_menu() on a non-object in ../wp-content/plugins/wp-native-dashboard/langswitcher.php on line 28

    The problem is the drop-down menu in admin bar of backend. If the drop-down menu is enabled in WP Native Dashboard settings "extend Backend Admin Bar with a language quick selector", (options->enable_language_switcher), the error is triggered in WordPress 3.6 and no login is possible any more.

    Technical reason: The drop-down menu is added via an 'init' hook while it should be added via an 'admin_bar_menu' hook, see also here.

    As a complete fix is too complex for this forum, here a simple "quickfix" with one change which will remove / not add the drop down menu and avoid the error:

    The fix requires FTP access and is done in line 24 of file langswitcher.php:

    Current version:

    if(function_exists('is_admin_bar_showing') && is_admin_bar_showing() && $this->as_admin_bar) {

    Quickfix:

    if(is_object($wp_admin_bar) && function_exists('is_admin_bar_showing') && is_admin_bar_showing() && $this->as_admin_bar) {

    Note: To still be able to change language in WordPress 3.6 backend, use "extend Personal Profile Settings with users prefered language", (options->enable_profile_extension) setting of WP Native Dashboard for now...

    http://wordpress.org/plugins/wp-native-dashboard/

  2. NickAndy
    Member
    Posted 11 months ago #

    Thanks Ov3rfly. Working once again! Greatly appreciated.

  3. mings
    Member
    Posted 11 months ago #

    Thank you very much Ov3rfly!

  4. Solko
    Member
    Posted 11 months ago #

    I love you xD

  5. codestyling
    Member
    Plugin Author

    Posted 11 months ago #

    The compatibility issue has been fixed at version 1.3.11

  6. iword2011
    Member
    Posted 11 months ago #

    I made the changes as mentioned above but now I get this error

    Warning: Missing argument 2 for wpdb::prepare(), called in /home/user/public_html/mydomain.com/wp-content/plugins/extended-categories-widget/libs/avh-db.php on line 62 and defined in /home/user/public_html/mydomain.com/wp-includes/wp-db.php on line 992
    
    Warning: Cannot modify header information - headers already sent by (output started at /home/user/public_html/mydomain.com/wp-includes/wp-db.php:992) in /home/user/public_html/mydomain.com/wp-includes/pluggable.php on line 875

    Can any body help I can't enter my wordpress site

  7. Ov3rfly
    Member
    Posted 11 months ago #

    @iword2011: The reason for your error is another plugin "AVH Extended Categories Widgets" and is obviously caused by changes from WordPress 3.4.x -> 3.5

    A fix for this plugin is e.g. here:
    http://wordpress.org/support/topic/missing-argument-2-for-wpdbprepare

  8. NickAndy
    Member
    Posted 11 months ago #

    Thanks codestyling. All working well!

  9. paulmuaddib
    Member
    Posted 10 months ago #

    This post is a life saver! :)
    Thank you!

Reply

You must log in to post.

About this Plugin

About this Topic