Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
i18nmenu_localize_tree() does not recurse into such subtrees (i18nmenu_localize_tree($tree[$index]['below'], $update);) where the parent tree is not customized.
Comment | File | Size | Author |
---|---|---|---|
#2 | i18n-966534-2.patch | 2.07 KB | pbuyle |
i18nmenu_customized_subtree.patch | 1.83 KB | Aron Novak |
Comments
Comment #1
Aron NovakComment #2
pbuyle CreditAttribution: pbuyle commentedI've two issues regarding subtree localization:
Given the following menu structure
With a stock i18n 6.x-1.x, the second and third levels menu item are not localized because because they are below a not customized item provide by Views. With the original patch, the second menu item is localized (meaning it is hidden for non-English language), but the third one isn't.
Or course, I well build menu shouldn't have an item with a language different than its parent's one. But it doesn't help to have such cases not localized. Because these cases are not localized, a site administrator may build an inconsistant menu. If the subtree were properly localized, the error would be easier to spot.
Here is a another patch that solve both issues.
Comment #3
PolWe are using this patch and it's working successfully ;-)
Thanks @mongolito404
Comment #4
marinex CreditAttribution: marinex commentedHi I would like to know whether 3th. patch at "sub-menu items not localized" has better solution of check value? Because there is sentence "there are times where 'below' is NULL rather than FALSE"...
Thanks for help M.
Comment #6
das-peter CreditAttribution: das-peter commentedI just created a related 7.x issue: #1693074: Change menu translation approach (i18n_menu_translated_menu_link_alter() skips item subtree processing)
Comment #7
joseph.olstad