To reproduce:
(1) enable entity_translation on a drupal 7 site
(2) admin/config/regional/language/add: add two languages
(3) set one of them as default
(4) uncheck the enabled checkbox in the english language.
(5) go to admin/structure/types/manage/article, and set Publishing options > Multilingual support to Enabled with field translation
(6) Create a new article,
(7) now click on the translate tab for the newly-created article, and we are seeing english even though it is disabled (I would expect not to see it).
A typical scenario for this bug would occur in a site which is in French and Spanish, but not in English. It is impossible to delete english, so we disable it. Editors should not see "English", then.
Cheers,
Albert.
Comment | File | Size | Author |
---|---|---|---|
#8 | 2339495-2-entity_translation-no-disabled-languages.patch | 3.13 KB | joseph.olstad |
| |||
#2 | 2339495-2-entity_translation-no-disabled-languages.patch | 3.13 KB | alberto56 |
Comments
Comment #1
alberto56 CreditAttribution: alberto56 commentedFor those who do not want disabled langues to be available in the language list, you can try one of these two approaches:
(1) set the entity_translation_languages_enabled variable to TRUE on your environment, like this:
drush vset entity_translation_languages_enabled 1
(2) try applying the enclosed patch.
I can't think of a use case where where one would want disabled languages to appear in the list, so I would propose applying the enclosed patch. The logic which uses a variable is still in place, but I have set the default value to TRUE rather than FALSE. That way, if this patch is applied, you can still revert to showing all languages in the language list by setting the entity_translation_languages_enabled variable to FALSE.
Comment #2
alberto56 CreditAttribution: alberto56 commentedHere is a better version of the patch:
(1) expand test coverage to test disabling of english as well as disabling of add-on languages.
(2) in function entity_translation_languages(), if i18n_node exists and we are dealing with a node, the existing module ignores the entity_translation_languages_enabled variable
In the patched version we are using if instead of elseif (in addition to using TRUE as the default value), so the entity_translation_languages_enabled variable is taken into account whether or not we are using i18n_node:
Comment #3
B-Prod CreditAttribution: B-Prod commented@alberto56: the issue #2497991: Allow translation of disabled languages gives an answer to your question in #1.
Dealing with disabled language may be really important in some circumstances. But I also agree that the configuration of such thing should be better explained.
Comment #4
GaëlGIn case i18n_node exists, we should use i18n settings (from admin/config/regional/i18n), as the @todo mentions.
Here's the right function, I think:
Comment #5
taote CreditAttribution: taote commentedYes, this is what I was looking for. When is it going to be implemented in the module?
Comment #6
hgoto CreditAttribution: hgoto as a volunteer commentedThe following issue may be related.
#1175170: Optionally enable disabled languages for entity translation.
Comment #7
candelas CreditAttribution: candelas as a volunteer commentedThanks @alberto56 Patch #2 works width last dev.
I don't have i18n_node enabled.
Comment #8
joseph.olstadre-upload same patch to trigger testbot
Comment #9
stefanos.petrakis@gmail.comFirst of all, an answer to the question:
The answer comes from the closely related issue (thanks @hgoto for linking) #1175170: Optionally enable disabled languages for entity translation., you can read the following in the issue's description:
Here are the various different at hand regarding this issue:
entity_translation_languages_enabled
variable?As there exist arguments for both sides, I would leave the option as it is. Allowing to control/modify this variable using the admin interface should solve the original issue reported here, this is being handled by #1175170: Optionally enable disabled languages for entity translation..
So, I would close this as a duplicate and point the action to #1175170: Optionally enable disabled languages for entity translation., moving some/all of the tests provided in the patch there as well, in case they are of use.