Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
hi, i have tested a lot, but i can't figure out whats going on.
i18n 7.x-1.8
entity_translation 7.x-1.0-beta2+33-dev
drupal 7.22
the case, as follows:
* i use the main menu with translated links.
* the default language is now set to german (after some links/nodes allready were created).
* i try to create a translation of a node, with, or without 'create menu link' checked and the corresponding english menu link is deleted.
* no other language is deleted and this happens if the english link is the original language, as also if not..
Comment | File | Size | Author |
---|---|---|---|
#17 | et-tset-bug-1982140-17-tests-only.patch | 1.95 KB | bforchhammer |
#17 | et-tset-bug-1982140-17.patch | 3.36 KB | bforchhammer |
#15 | et-tset-bug-1982140-15-tests-only.patch | 1.46 KB | bforchhammer |
#15 | et-tset-bug-1982140-15.patch | 2.86 KB | bforchhammer |
#10 | before translating test2.png | 18.13 KB | carligraph |
Comments
Comment #1
carligraph CreditAttribution: carligraph commentedi tried now to completely recreate the menu and can confirm, that it always deletes the original language (ie first created).
Comment #2
carligraph CreditAttribution: carligraph commentedanother weird thing is, that the source language changes to the last updated language, when editing the menu-link-translation...
Comment #3
bforchhammer CreditAttribution: bforchhammer commentedAccording to our tests this should be working. If you have a look at
EntityTranslationMenuTranslationTestCase::testMenuLocalization
, you'll see that we create a page in English with a Spanish translation and check that both menu links exist afterwards. Editing is checked as well, and doesn't affect the respective other language in our test case. (All tests are passing.)Are you testing on a clean install, or could it be another module interfering?
Comment #4
carligraph CreditAttribution: carligraph commentedyou are right, it's not a fresh install - it's a real-life test ;)
i will try it soon on a fresh install and report..
Comment #5
carligraph CreditAttribution: carligraph commentednow i tried it with a completely fresh install and the same thing happens again, when translating into a third language..
it always deletes the menu entry from the original language.
it's the same when using the main menu, as using a seperate menu for each language.
Comment #6
bforchhammer CreditAttribution: bforchhammer commentedOkay, so does this only happen with a third language? Can you check whether this is related to the current interface language at all? (That is, does it make a difference whether your add a translation with the form being in English vs. the form being in German?)
Comment #7
carligraph CreditAttribution: carligraph commentedyes, it only happens when using a third language.
no, it doesn't depend on which language-interface i am, while submiting the form.
while testing around i recognized that it only deletes links at the first level from which it contains child-links.
(this happens when translating the article, even if i dont check the box to add a menu link)
for better understanding, an example:
when translating node 2, it deletes link1 here, when translating node 3, it deletes sublink1. better said: it changes the link from the original language to the translated language.
Comment #8
bforchhammer CreditAttribution: bforchhammer commentedSo it always deletes the menu link which is associated with the node that you're currently translating. That kindof makes sense.
I will have to test this out myself later. If you could provide a step-by-step description of how to reproduce the behavior from a freshly installed version, that would be helpful. (Including configuration steps taken etc.)
Comment #9
carligraph CreditAttribution: carligraph commentedstep-by-step description:
now link1--sublink1 from 1st language changed to the third language. link1--sublink1--sublink2 is still there but has also moved with link1--sublink1 but not changed the language.
edit: maybe i made a mistake here, so not confirmed (the second time it was working):
meanwhile i did one more fresh install and the case appears allready, when translating the 3rd article (and link1--sublink1--sublink2) to the second language (German, English=orig). also the translated article/title (the only translatable field by now) disappears (switches to the translated language) now.
Comment #10
carligraph CreditAttribution: carligraph commentedhere are two pictures from the menu structure before and after translating the 2nd article to the 3rd language.
Comment #11
carligraph CreditAttribution: carligraph commentedit seems, it has to do something with this warning/function:
changing line 336 to
list($entity->menu['menu_name'], $entity->menu['plid']) = explode(':', $entity->menu['parent'][0]);
seems to work but only, when editing/translating an existing article and not when adding a new one and the warning
explode() expects parameter 2 to be string
in menu.module persists..Comment #12
bforchhammer CreditAttribution: bforchhammer commentedFirst off, thanks for your detailed steps to reproduce. I think I now understand what this issue is about :)
So, when you tick the "Menu link enabled only for the Deutsch language" checkbox on a node, it switches the mode of translation from "localization" to "translation sets" for menu items. This means that instead of having just one (localized) menu item on all languages, you will have multiple menu items for different languages.
Whenever you tick this checkbox for the first time on a node (or on one of its translations), it will take the existing menu item, and convert it to the current language. This means, it won't be shown for other languages anymore, thereby appearing to delete menu items for other (e.g. the original) languages.
The obvious "quick fix": If you want separate menu items for different languages (which I assume you do according to your example), tick the checkbox already when you create the original node; then you won't loose it when you create new ones for other languages. Alternatively, go back afterwards and recreate your missing menu items. They should not go missing again afterwards.
Does this explain your situation?
The notices look like they might be related to #1992588: PHP Notices on node page. If you can, please see if the patch over there fixes your notices.
Also, I guess we could turn this issue into a feature request: we can probably try to handle the switch from the localization mode to translation sets better, i.e. try to create additional menu items when switching from localization to translation sets.
Comment #13
carligraph CreditAttribution: carligraph commentedif i activate that checkbox on a new node the same problem appears again: when translating into the 3rd language and the menu-link has child-links the original language will be changed into the 3rd language. so it doesn't fix the problem for me.
the warning from #11 was only produced, when using hierarchical select menu (7.x-3.0-alpha5). ok, thats maybe another issue, but with this module it doesn't even work to translate/add a menu-link within the node-form.
because of that i think it has something todo with the hierarchy of the menu and tried to change that line in entity_translation_i18n_menu.module and, voila, it was working to add a translation of the menu-link and also the original language wasn't overwritten anymore. the only thing: i doesn't work to add a menu-link, when creating a new node, it only works when editing a firstly created node.
Comment #14
carligraph CreditAttribution: carligraph commentedComment #15
bforchhammer CreditAttribution: bforchhammer commentedHm, this took me a while to reproduce, but I think I was finally able to do so... I think this only happens when using translation sets and adding a second translation. Let's see what the test bot thinks.
Comment #17
bforchhammer CreditAttribution: bforchhammer commentedHm, #15 failed for the wrong reason; let's try this again... The test-only patch should fail, because it tries to reproduce the faulty behavior described above. The other one should fix it and pass.
Comment #18
bforchhammer CreditAttribution: bforchhammer commented@carligraph: Can you download and apply et-tset-bug-1982140-17.patch, and check whether that fixes your problem?
Comment #19
carligraph CreditAttribution: carligraph commentedthanks for the patch - it works!
i don't know, if it has something to do with this issue, but the warning
still exists when using hierarchical select menu and no menu-link is created with that.
Comment #20
bforchhammer CreditAttribution: bforchhammer commentedCool, then I'll commit #17 soon.
The hierarchical select warning looks unrelated. It seems to appear because HS replaces the "parent menu item" form element and thereby changes the expected format of it's value; Core and ET assume that it's a string, HS changes it into an array. I think this needs to be fixed in the HS module; if not, it should go into a new issue.
Comment #21
bforchhammer CreditAttribution: bforchhammer commentedCommitted and pushed #17.
Comment #22.0
(not verified) CreditAttribution: commentedupdated text to correct entity_translation version