Make WordPress Core

Opened 14 years ago

Closed 14 years ago

#24014 closed defect (bug) (fixed)

Undefined variable: nav_menu_id in /wp-includes/nav-menu.php on line 195

Reported by: chipbennett Owned by: SergeyBiryukov
Priority: normal Milestone: 3.6
Component: Menus Version: 3.6
Severity: minor Keywords: has-patch
Cc: Focuses:

Description

To reproduce:

  1. Delete an existing nav menu

Error (PHP notice):

Notice: Undefined variable: nav_menu_id in /xxxxxx/wp-includes/nav-menu.php on line 195

​Core code:

      // Remove this menu from any locations.
193	        $locations = get_theme_mod( 'nav_menu_locations' );
194	        foreach ( (array) $locations as $location => $menu_id ) {
195	                if ( $menu_id == $nav_menu_id )
196	                        $locations[ $location ] = 0;
197	        }
198	        set_theme_mod( 'nav_menu_locations', $locations );

Offending line:

if ( $menu_id == $nav_menu_id )

...but $nav_menu_id is not defined in the function.

Attachments (2)

24014.patch​ (533 bytes ) - added by SergeyBiryukov 14 years ago.
24014.2.patch​ (528 bytes ) - added by c3mdigital 14 years ago.

Download all attachments as: .zip

Change History (6)

#1 @SergeyBiryukov
14 years ago

  • Milestone Awaiting Review → 3.6

Introduced in [23897].

#2 follow-up: @SergeyBiryukov
14 years ago

  • Keywords has-patch added

@c3mdigital
14 years ago

#3 in reply to: ↑ 2 @c3mdigital
14 years ago

Replying to SergeyBiryukov:

Should have refreshed the page. Didn't see your patch.

#4 @SergeyBiryukov
14 years ago

  • Owner set to SergeyBiryukov
  • Resolution → fixed
  • Status new → closed

In 23941:

Use correct variable. fixes #24014. see #23119.

Note: See TracTickets for help on using tickets.