Deleted menus are still referenced as available menus on content types and cause an error when content is edited

Created on 14 October 2015, almost 10 years ago
Updated 31 January 2023, over 2 years ago

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

  1. Create a menu.
  2. Create, then edit a node type. In Menu Settings -> Available menus. Select the previously created menu. ( Figure )
  3. Save the node type.
  4. Delete the previously created menu. ( Figure )
  5. Create or edit a node entity, with the previous node type.
  6. 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.

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Closed: outdated

Version

10.1

Component
Menu UI 

Last updated about 1 month ago

No maintainer
Created by

🇨🇿Czech Republic jan.rysavy

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024