On our sites, already existing translations disappear and the menu links are shown in English.
I debugged the code and found that the entries for the textgroup menu in the tables i18n_string and locales_source are gone.
In addition the existing translations seem to be "moved" to the default textgroup.

So far I have no idea what causes this trouble. But as a workaround I run these queries to bring back the database entries when a translation disappears:

INSERT INTO locales_source (location, textgroup, source, context, version) SELECT CONCAT('menu:item:', mlid, ':title'), 'menu', lsa.source, CONCAT('item:', mlid, ':title'), 1 FROM locales_source AS lsa JOIN menu_links ON (lsa.source = link_title) JOIN menu_custom USING (menu_name) LEFT JOIN locales_source AS lsb ON (lsa.source = lsb.source AND lsb.textgroup = 'menu') WHERE i18n_mode = 5 AND lsa.textgroup = 'default' AND lsb.textgroup IS NULL;

REPLACE INTO i18n_string SELECT DISTINCT lid, textgroup, context, mlid, 'item', 'title', mlid, '' FROM locales_source JOIN menu_links ON (source = link_title) WHERE textgroup = 'menu' AND context = CONCAT('item:', mlid, ':title');

Afterwards the menu link could be translated again.

Comments

Jose Reyero’s picture

Priority: Critical » Normal

Need steps on how to reproduce this.

mkalkbrenner’s picture

That's the problem. I don't know how this happens. The only thing I can say is, that the sites are "stable", what means that there's no configuration going on. But the translations randomly disappear every two or three days. And it only effects two or three entries when it happens. But every time it effects different entries.
Very strange ...

mkalkbrenner’s picture

Issue summary: View changes

Updated issue summary.

mkalkbrenner’s picture

Issue summary: View changes

Updated issue summary.

mkalkbrenner’s picture

Priority: Normal » Major

It happened again.
We moved a menu entry from the second level to the first level and than again back to the second level.
The entry of that menu entry disappeared from the menu textgroup!

mstiem’s picture

Hey guys,
I have the same issue in my project. When I shuffle my menu entries around several translations are gone. Can't find any fix for that.

cspitzlay’s picture

One additional detail:
The last time it happened to us the user was logged in on the German version of the site.
The deleted translations were all German, while the Dutch ones remained intact.

Jose Reyero’s picture

Priority: Major » Normal
Status: Active » Postponed (maintainer needs more info)

Yes, this is useful information, but still, we don't have a step by step to reproduce the bug, which makes it kind of random, you cannot tell when it happens, thus you cannot tell how/when it is fixed.

mattew’s picture

Priority: Normal » Critical

I encountered the same issue and there is a simple step by step to reproduce :

We have a website using at least two languages : english and french. And the content type allow to create a menu item from the node form.

  1. Choose a page with a translated menu item, in english and french ;
  2. Edit this page from english website
  3. Right on the Edit form, switch to French, using language links at the top of the page ;
  4. Edit something on the page (maybe not required);
  5. Save

You will be redirected to french version of the node, and the menu item is in English. The translation seems to be lost...

When viewing the menu item translation table, we can see that the menu is marked as translated, but the text is in english.

I think this issue is critical because data is lost at each page saving.

N.B. : We are using Entity translation.

SqyD’s picture

This sounds very similar to this issue that was found and fixed in the Expire module #1451336: Reverting a node revision deletes menu item and this issue in Token #1317926: menu_tokens function should not change the node object. The fix involved avoiding doing operations on the the menu item directly but on a clone of the object. It wouldn't surprise me if this could be a fix for this issue as well.

mkalkbrenner’s picture

Status: Postponed (maintainer needs more info) » Active

@SpyD: Thanks for that information. I hope to find some time to debug this soon.

mkalkbrenner’s picture

Issue summary: View changes

Updated issue summary.

Marty2081’s picture

Issue summary: View changes

I have the same issue in a project of ours. We have a custom module that defines a MENU_NORMAL_ITEM with an English title. The title is translated through the translation interface and shows up fine until we change the weight of the menu-item. Then, the English title is shown where we saw the translation before. When we "reset" the menu item, the translation works again. Our workaround is to move the other menu items around and not touch the menu item from the module, but that won't do in the long run.

GuillaumeDuveau’s picture

I can't reproduce #10, Marty2081 could you reproduce it with an existing contributed module and detail all the steps ?
For example, are you translating the menu item of a menu set to "localize and translate" with i18menu interface ?
Or translating with admin/config/regional/translate ?
I believe that admin/config/regional/translate should be used to deal with menu items provided by contributed modules.

Some should have a look at that issue, too : #1693074: Change menu translation approach (i18n_menu_translated_menu_link_alter() skips item subtree processing) : menu links become disabled upon saving a node which is in a different language than the interface

Marty2081’s picture

Yes, the menu (Main menu) is set to "translate and localize". The menu item is translated using admin/config/regional/translate.

When the menu-item is reset (and the translation works), there is also a translate link in the menu edit screen leading to admin/structure/menu/item/2756/translate. However that link results in a 'access denied' message.

Once the menu-item is saved in another position, the link results in a: 'This object has no strings available for translation.'

GuillaumeDuveau’s picture

@Marty, try this :
- reset the menu item, the "reset" option must then disappear, and the menu item language must be set to "no language"
- check that the translation works, even if the position of your item is not good of course because of the reset
- go to LANGUAGE/admin/structure/menu/manage/MENU and re-order the item. If you just go to /admin/structure/menu/manage/MENU without the LANGUAGE prefix (for the other language than english which is the default one in my setup), then you will re-order the item, but you will loose the translation.

Thing is, we have 2 different problems in that issue, it should maybe be split in 2 issues :
- i18n_menu should deal properly with menu items provided by modules (here ?)
- menu links become disabled upon saving a node which is in a different language than the interface, see patch in #1693074: Change menu translation approach (i18n_menu_translated_menu_link_alter() skips item subtree processing)

Marty2081’s picture

@guix, first of all: thanks for you time and trying to help me. I appreciate it.

Unfortunately, if I do as you suggest the translation keeps breaking. I have Dutch as the default language with no path prefix and English as the second language with 'en' as the path prefix. When I reset the menu-item, the language is set to "no language". When I re-order the menu-item, the language stays "no language". I've tried re-ordering at en/admin/structure/menu/manage/MENU, but the translation still breaks. If I reset the item the translation works again.

I don't know if #1693074: Change menu translation approach (i18n_menu_translated_menu_link_alter() skips item subtree processing) is related to this issue.

GuillaumeDuveau’s picture

@Marty2081: You are welcome, well I'm trying like you said :) Well, last idea I have is to try to reset, then re-order from admin/structure/menu/manage/MENU (that is, with the Dutch interface). But you probably already tried it.

Jose Reyero’s picture

Priority: Critical » Normal

Just raising the priority of the issue won't help fixing it faster.

ChrisValentine’s picture

I'm getting this too. Not entirely sure what triggers it but its not necessarily related to the page I'm working on. I add some links, translate some pages, go back to the menu management and some apparently random links have become disabled.

Versions:
Core - 7.26
Internationalization - 7.x-1.10
Content translation - 7.26
Entity Translation - 7.x-1.0-beta3
Field translation - 7.x-1.10
String translation - 7.x-1.10
Block languages - 7.x-1.10
Language Cookie - 7.x-1.8

ChrisValentine’s picture

Have just found some consistency. If you have a Page that has a menu entry and you translate it and put it into the menu under its new language - if you ever edit the page again, its menu entry will be disabled.

cspitzlay’s picture

@ChrisValentine: Are your menu entries just disabled, or are the translations removed from the database? For us it is the latter.

ChrisValentine’s picture

No, they're just disabled - toggle the checkbox and they re-appear.

ChrisValentine’s picture

I've also just noticed that the "Parent item" selector in the menu section of the page edit form also incorrectly shows the status of links already in the menu as disabled.

Owen Barton’s picture

For folks ending up on here using Features, you should check #1632378: Why do menu items need to be marked as customized ? - this appears as disappearing translations when you revert features.

ckng’s picture

Not sure if it is similar issue, for me the menu links is intact, but the language column is reset to und. What triggered the reset seems to be features export (NOT revert), but per #22, the 'customized' is 1.