The menu link of the default language is overwritten if you add/edit a translation.
Steps to reproduce:
- Install and enable token module
- Enable the translation for a content type
- Enable translation for menu links
- Set German as default language
- Create a node in French and on the node creation form, click "Provide a menu link" and add a menu link
- Translate this node and translate the menu link
The menu link of the default language, German, will be overwritten by the changes made to the menu link on the French translation. It also happens with English as the default language.
If you change the menu link of the default language, German, back to what it was before, the menu link on the French translation will not be changed. But if you edit the French translation and save the changes, the menu link of the French translation will overwrite the German menu link.
In order to fix above issue:
1. Uninstall token module
2. Currently, exploring other ways to fix this problem
Comment | File | Size | Author |
---|---|---|---|
#17 | menu_link_of_default-2769705-16.patch | 4.71 KB | Bambell |
Comments
Comment #2
Gábor HojtsyHow would token module affect this and why?
Comment #3
Gábor HojtsyComment #4
BerdirI guess this was introduced by #2670120: Patterns with node:menu-link tokens don't work on first node save. Pinged @larowlan.
Comment #5
criscomAny progress on this?
Comment #6
Bambell CreditAttribution: Bambell at MD Systems GmbH commentedHere's a work in progress patch with a failing test exposing the bug. I think it's close, but not quite yet. I'll work a bit more on this today and will continue tomorrow if no one else picked this up and if it isn't solved yet.
Comment #9
Bambell CreditAttribution: Bambell at MD Systems GmbH commentedWanted to just add a translation to the
MenuLinkContent
, but here we go, that should work.Comment #10
Bambell CreditAttribution: Bambell at MD Systems GmbH commentedShould rather check if the active langcode of the loaded
MenuLinkContent
is the same as the one of the Node. If not, create a new one instead. Returns to Needs work, will fix shortly.Comment #11
Bambell CreditAttribution: Bambell at MD Systems GmbH commentedMultilingual
menu-link
token replacement seems broken as well (as shown by this test failing).Comment #14
Bambell CreditAttribution: Bambell at MD Systems GmbH commentedSo here we go with this, now adding a translation for the menu link. Nota bene the
@todo
.Comment #15
BerdirLets do this like _menu_ui_node_save().
There is also the isTranslatable() check. did you already create a core issue about it not working as expected when translation is disabled?
As discussed, we should at least add a (All languages) suffix on the ui if translation is disabled or have some other hint..
Comment #16
larowlanThanks @Bambell, didn't get to this on Friday
Comment #17
Bambell CreditAttribution: Bambell at MD Systems GmbH commentedHere we go. Will open a Core issue for menu link translation / "(all languages)", as discussed.
Comment #18
Bambell CreditAttribution: Bambell at MD Systems GmbH commentedComment #20
BerdirThanks, pushed.