Node edit form re-saves menu items even if no change has occurred

Created on 10 November 2024, about 1 month ago

Problem/Motivation

When a node is saved the menu UI module re-saves the menu link content, irrespective of whether its changed, this looks to be by design, but has some knock on repercussions (such as clearing the menu cache - which I've linked as a related issue.)

I might be wrong, but it feels like the menu link content should only be re-saved if the item has changed, this would then prevent any further ramifications such as the cache being invalidated for the menu, unless the menu has actually changed.

Steps to reproduce

  1. Edit a node with a menu link.
  2. The menu link content will be updated
  3. The menu cache will be invalidated

Proposed resolution

When updating the menu link content in the _menu_ui_node_save method first check if any of the values have been changed.

🐛 Bug report
Status

Active

Version

10.3

Component

menu system

Created by

🇬🇧United Kingdom andy_w

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024