Finding most popular menu should ignore current node

Created on 18 September 2024, 2 months ago
Updated 20 September 2024, 2 months ago

Problem/Motivation

When looking for the most popular menu name among translations, _menu_link_sync_get_most_popular_menu_among_siblings include the node.

Because Node:load() return the cached version of the node, drupal return the temporary translation.
That mean when syncing MenuLink when creating a translation, Node:load() will return an existing translation with the source translation values.

Ex, when translating a menu in English:

field_menulink:
    en:
        -
            menu_name: main_menu_en
    de:
        -
            menu_name: main_menu_en
        

Steps to reproduce

- Add a translation to a node
- Sync menulink
- Use debug tools to inspect loop

Proposed resolution

Ignore menu item based on MenuPluginId

🐛 Bug report
Status

Active

Component

Code

Created by

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

Comments & Activities

Production build 0.71.5 2024