Problem/Motivation
In #2302137: Improve performance when menu link value matches with the original value we implemented an optimisation to avoid doing unnecessary database updates if the new data matched the existing data. There was some debate about whether or if no update was done whether or not \Drupal\Core\Menu\MenuTreeStorageInterface::save() should return an empty array.
The current documentation is:
* @return array
* The menu names affected by the save operation. This will be one menu
* name if the link is saved to the sane menu, or two if it is saved to a
* new menu.
This is used to invalidate cache tags.
Proposed resolution
Discuss the impact.
Remaining tasks
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| menu-tree-empty-return.patch | 4.28 KB | alexpott |
Comments
Comment #2
alexpottAs stated in #2302137-38: Improve performance when menu link value matches with the original value I'm not entirely convinced by this change because:
Yes they'd be doing it wrong but it's still possible.
Comment #3
catchAfter thinking through this on the issue, I think it should stay as it is unless we can demonstrate it's better for cache longevity.
Comment #4
dawehnerI have a hard time judging this. Given that this other issue is a purely internal optimization it should not change the public interface.
Comment #17
smustgrave commentedThank you for creating this issue to improve Drupal.
We are working to decide if this task is still relevant to a currently supported version of Drupal. There hasn't been any discussion here for over 8 years which suggests that this has either been implemented or is no longer relevant. Your thoughts on this will allow a decision to be made.
Since we need more information to move forward with this issue, the status is now Postponed (maintainer needs more info). If we don't receive additional information to help with the issue, it may be closed after three months.
Thanks!