Problem/Motivation
When a menu is deleted, which was previously referenced in a node types' available menu settings, an error is thrown and "parent item" select field contains invalid options.
Issue is still present in 8.2, 8.3., 8.5.4
To reproduce
Required modules: menu_ui
, node
- Create a menu.
- Create, then edit a node type. In Menu Settings -> Available menus. Select the previously created menu. (Figure)
- Save the node type.
- Delete the previously created menu. (Figure)
- Create or edit a node entity, with the previous node type.
- The following issues arise:
An error is thrown on a node entity edit form:
Notice: Undefined index: MENUNAME in menu_ui_form_node_form_alter() (line 279 of core/modules/menu_ui/menu_ui.module).
And invalid parent item select options:
Proposed resolution
Add soft dependency from menu configs to node type.
Remaining tasks
Patch, tests.