Opened 11 years ago
Closed 11 years ago
#26287 closed defect (bug) (fixed)
Bug when removing a location when still attached to a menu
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 3.8 | Priority: | normal |
Severity: | minor | Version: | 3.6 |
Component: | Menus | Keywords: | has-patch needs-testing |
Focuses: | Cc: |
Description
When creating a menu and adding it to a location trough the checkboxes it raises an error when this menu get's removed but still is connected to the location:
Notice: Trying to get property of non-object in wp-includes/nav-menu.php on line 597 Notice: Trying to get property of non-object in wp-includes/nav-menu.php on line 597
In the menu dropdown there is also "empty" slots with comma's, see it's still somewhere in the database.
Attachments (2)
Change History (7)
#1
in reply to:
↑ description
@
11 years ago
Replying to nielsvanrenselaar:
When creating a menu and adding it to a location trough the checkboxes it raises an error when this menu get's removed but still is connected to the location:
Notice: Trying to get property of non-object in wp-includes/nav-menu.php on line 597 Notice: Trying to get property of non-object in wp-includes/nav-menu.php on line 597
In the menu dropdown there is also "empty" slots with comma's, see it's still somewhere in the database.
Sorry, I mean it occurs when you remove the location from i.e. your functions.php. Not when you remove the menu but when the menu is still connected to that location!
#2
@
11 years ago
- Summary changed from Bug when removing a menu when still attached to a location to Bug when removing a location when still attached to a menu
#3
@
11 years ago
- Keywords has-patch needs-testing added
IMO this is not likely to happen way too often, but it's still possible (for example, menus being updated after a theme update). Since the menu locations are fetched as get_theme_mod( 'nav_menu_locations' )
the simple checks in the patch should not cause significant performance drawbacks.
Screenshot of dropdown