Changes between Initial Version and Version 1 of Ticket #58044
- Timestamp:
- 04/01/2023 10:01:08 PM (19 months ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #58044
- Property Keywords reporter-feedback added
-
Ticket #58044 – Description
initial v1 1 /wp-includes/nave-menu.php has an issue handling bad $menu_item.1 `/wp-includes/nav-menu.php` has an issue handling bad `$menu_item`. 2 2 3 3 4 The problem is with trying to call **get_post_status(**). If a post with type ''nav_menu_item'' has a problem (I think not having a correct parent or something), the call to **get_post($menu_item->object_id)** returns NULL which then causes an error message from **get_post_states()**.4 The problem is with trying to call `get_post_status()`. If a post with type `nav_menu_item` has a problem (I think not having a correct parent or something), the call to `get_post($menu_item->object_id)` returns NULL which then causes an error message from `get_post_states()`. 5 5 6 I had to search the site database to find the offending menu item on my theme development site and deleted the bad menu. I think I likely deleted a page or post that had been include in a menu definition, or perhaps it was because I typically use the Parent Page to define the default menu, which is still supported bu seldom used.6 I had to search the site database to find the offending menu item on my theme development site and deleted the bad menu. I think I likely deleted a page or post that had been include in a menu definition, or perhaps it was because I typically use the Parent Page to define the default menu, which is still supported but seldom used. 7 7 8 8 This error only seems to appear when using the Customizer, I'm guessing while it is generating the ''Menus'' option. Didn't get error from Dashboard Menu, nor have I tried this on a block theme. 9 9 10 The problem is found around line 833 in nav-menu.php.10 The problem is found around line 833 in `nav-menu.php`. 11 11 12 12 Here's a possible fix which worked with my bad menu definition, but the problem might be deeper.