Title: Bug when debug is activated
Last modified: June 8, 2021

---

# Bug when debug is activated

 *  Resolved [davidwebca](https://wordpress.org/support/users/davidwebca/)
 * (@davidwebca)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/bug-when-debug-is-activated/)
 * 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](https://wordpress.org/support/users/davidwebca/)
 * (@davidwebca)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/bug-when-debug-is-activated/#post-14590133)
 * 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 4 years, 11 months ago by [davidwebca](https://wordpress.org/support/users/davidwebca/).

Viewing 1 replies (of 1 total)

The topic ‘Bug when debug is activated’ is closed to new replies.

 * ![](https://ps.w.org/bcm-duplicate-menu/assets/icon-256x256.png?rev=1983629)
 * [BCM Duplicate Menu](https://wordpress.org/plugins/bcm-duplicate-menu/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/bcm-duplicate-menu/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/bcm-duplicate-menu/)
 * [Active Topics](https://wordpress.org/support/plugin/bcm-duplicate-menu/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/bcm-duplicate-menu/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/bcm-duplicate-menu/reviews/)

 * 1 reply
 * 1 participant
 * Last reply from: [davidwebca](https://wordpress.org/support/users/davidwebca/)
 * Last activity: [4 years, 11 months ago](https://wordpress.org/support/topic/bug-when-debug-is-activated/#post-14590133)
 * Status: resolved