WordPress.org

Make WordPress Core

Opened 8 months ago

Closed 8 months ago

#25064 closed defect (bug) (fixed)

Nav Menu: Bug while assigning a new menu to an existing menu location

Reported by: ocean90 Owned by: nacin
Milestone: 3.6.1 Priority: normal
Severity: normal Version: 3.6
Component: Menus Keywords: has-patch commit fixed-major
Focuses: Cc:

Description

Steps to reproduce:

  • Theme with menu support
  • get_theme_mod( 'nav_menu_locations' ) needs to be empty or shouldn't include the menu location for the next steps
  • Go to Manage Locations and select Use new menu
  • Create the new menu and save it

Expected: The menu is assigned to the location.
Current: It's not assigned.

get_theme_mod( 'nav_menu_locations' ) doesn't return all registered menu locations means the isset() check fails.

Attachments (2)

25064.patch (1.5 KB) - added by ocean90 8 months ago.
25064.2.patch (2.1 KB) - added by nofearinc 8 months ago.
small optimization added in wp-includes/nav-menu.php

Download all attachments as: .zip

Change History (8)

ocean908 months ago

comment:1 ocean908 months ago

25064.patch uses get_registered_nav_menus() for the isset() check.

nofearinc8 months ago

small optimization added in wp-includes/nav-menu.php

comment:2 nofearinc8 months ago

  • Cc mario@… added

comment:3 nacin8 months ago

In 25195:

Nav menus: Allow assigning a new menu to an existing location when no theme setting is currently saved.

props ocean90.
see #25064, for trunk.

comment:4 nacin8 months ago

In 25196:

Use get_nav_menu_locations() in wp_delete_nav_menu().

props nofearinc.
see #25064.

comment:5 nacin8 months ago

  • Keywords commit fixed-major added

I suggest we only merge [25195] to 3.6.1.

comment:6 nacin8 months ago

  • Owner set to nacin
  • Resolution set to fixed
  • Status changed from new to closed

In 25232:

Nav menus: Allow assigning a new menu to an existing location when no theme setting is currently saved.

Merges [25195] to the 3.6 branch.

props ocean90.
fixes #25064.

Note: See TracTickets for help on using tickets.