Opened 13 years ago
Closed 13 years ago
#26287 closed defect (bug) (fixed)
Bug when removing a location when still attached to a menu
| Reported by: | nielsvanrenselaar | Owned by: | SergeyBiryukov |
|---|---|---|---|
| Priority: | normal | Milestone: | 3.8 |
| Component: | Menus | Version: | 3.6 |
| Severity: | minor | Keywords: | has-patch needs-testing |
| Cc: | Focuses: |
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
@
13 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
@
13 years ago
- Summary Bug when removing a menu when still attached to a location → Bug when removing a location when still attached to a menu
#3
@
13 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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Screenshot of dropdown