• Resolved davidwebca

    (@davidwebca)


    A fatal crash happens when server settings and debug is activated in this line : bcm-duplicate-menu.php:50

    There should be a check for “isset($_GET[‘menu’])” before trying to access it because by default, when we arrive in the menu editing screen, there’s no menu specified in the query string. Doesn’t crash on most live installs because debug isn’t activated, but most devs have this activated.

Viewing 1 replies (of 1 total)
  • Thread Starter davidwebca

    (@davidwebca)

    I just started developing another website since that that initial message and I had the same problem so hacked in a little bit of code to prevent the issue by filling the “menu” query string key manually with a fake value. This prevents the crash and lets WordPress show the last menu modified like it’s supposed to do.

    
    add_action('admin_head', function() {
        $current_screen = get_current_screen();
        if($current_screen->id == 'nav-menus' && !isset($_GET['menu'])) {
            $_GET['menu'] = '-1';
        }
    });
    

    Just thought I would share and write it down here in case someone stumbles on this.

    • This reply was modified 3 years, 5 months ago by davidwebca.
Viewing 1 replies (of 1 total)
  • The topic ‘Bug when debug is activated’ is closed to new replies.