Problem/Motivation

When saving a node using the menu link module and this as a widget, the sibling menu items are re-saved every time. Even if the weight of those items didn't change. This causes unnecessary cache invalidation, hook invocations and time.

Steps to reproduce

  1. Implement the module as describe on a node.
  2. Create a 'hook_node_update' function that contains some logging of the node id.
  3. create various menu items.
  4. re-save a node that is sibling to those menu items
  5. Observer your logging from the hook that the pages unnecessarily get re-saved.

Proposed resolution

Check if the menu item already has the weight from the form. If the weights match, skip it.

Remaining tasks

Patch

User interface changes

None

API changes

None

Data model changes

None

CommentFileSizeAuthor
#2 menu_link_weight-3410674.patch648 bytespookmish
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

pookmish created an issue. See original summary.

pookmish’s picture

Status: Active » Needs review
StatusFileSize
new648 bytes