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
- Implement the module as describe on a node.
- Create a 'hook_node_update' function that contains some logging of the node id.
- create various menu items.
- re-save a node that is sibling to those menu items
- 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
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | menu_link_weight-3410674.patch | 648 bytes | pookmish |
Issue fork menu_link_weight-3410674
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
Comment #2
pookmish commented