Menu UI node form alter hook invoked in module node form alter hook

Created on 26 October 2023, 8 months ago
Updated 3 November 2023, 8 months ago

Problem/Motivation

Invoking menu_ui_node_form_alter in domain_menus_form_node_form_alter is causing the menu_ui_form_node_form_submit action to get added twice to node edit pages. Calling menu_ui_form_node_form_submit twice when deleting the link results in the first run successfully deleting the link, followed by the error Call to a member function delete() on null in menu_ui_form_node_form_submit() (line 327 of /code/web/core/modules/menu_ui/menu_ui.module)

Steps to reproduce

  1. Add a menu link using the check box under Menu Settings in the node edit page
  2. Navigate back to the node edit page for the same node
  3. Remove the menu link using the same checkbox

Proposed resolution

Remove the invocation of menu_ui_node_form_alter in domain_menus_form_node_form_alter. The update to set the module weight should be enough for the alter hooks to run in the correct order.

Remaining tasks

Review and test patch

πŸ› Bug report
Status

Fixed

Version

3.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States hlopez

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

Merge Requests

Comments & Activities

Production build 0.69.0 2024