We have the language element hidden for all editing operations for node content. When editing an English language node (English is the default language), clicking Translate, and then clicking a language link, like French, to add its translation, the hidden form language element is set to English because it pulls the language from the source entity in the getLanguage() method. When the element is hidden and the user is adding a non-English translation, the language element should be set to the destination language.
The primary issue we are having based on this problem is that every URL in url_alias for each translation of a node entity has the same language value, which is 'en'. So, we can translate node data, but then the URL alias for the non-English translations all still have the 'en' value. So, when you build a link to the node, the most recent url_alias record is retrieved, so you might see a French URL when browsing in English.
Basically, the language being saved in url_alias() is incorrect.
Note that I am fairly new to this module, so the actually error may be taking place elsewhere, when the translation data is saved, and I am still looking into that part.
Comment | File | Size | Author |
---|---|---|---|
#2 | path.patch | 685 bytes | maks9889 |
#2 | entity_translation.patch | 1.18 KB | maks9889 |
Comments
Comment #1
justageek CreditAttribution: justageek commentedComment #2
maks9889 CreditAttribution: maks9889 commentedIt happens because Entity translation uses field "language" for indicating "Original language" and function path_form_element_validate() in path.module changes form language to be equal to this field. I made little edit of these modules and attached patches for both.
PS. Aliases also have other multi-language issue and me write it little later.
Comment #3
Frando CreditAttribution: Frando as a volunteer commentedI also ran into this bug. In my case, I got "The alias is already in use." validation errors, because path.module checked for uniqueness in the wrong language (original language instead of current translation), meaning that whenever the given alias exists already in the original language, but not in the current translation's language, path.module raised a wrong validation error because it picks up the wrong language.
Because I didn't want to patch core or entity_translation for this atm, I used the following code in a custom module as a workaround. It works perfectly well. The custom module needs a weight of at least 1 though to run after path module's form_alter.
Comment #4
Ludo.RI've used #3 solution and it seems to work very well!