The set-up is as follows:
1. Enable entity translation module
2. Enable field translation on a content-type
3. Enable workbench moderation on the same content-type
4. Create a node in the base language and publish it
5. Select the translation tab and create a translation, publish it
6. Look at the url alias for your two nodes in admin/config/search/path/list and notice that there are two paths one in each language
7. Edit the translated node and manually change the path
8. Refresh the url alias listing and now the original node and the translated node url aliases are both set to the translated node's language
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | et_language-1946392-1.patch | 701 bytes | joel_osc |
Comments
Comment #1
joel_osc commentedHere is a patch which seems to fix it by changing how workbench moderation decides on the path language. I just copied the method from the path module which uses "$langcode = entity_language('node', $node);"
Comment #2
alanburke commentedExcellent work.
Comment #3
weri commentedWe had the same problem with the path alias in the described scenario.
I applied and tested the patch. The patch works great and solves the problem.
Thanks for the patch!
Comment #4
cmoad commented+1 on getting this pushed. We had the same problem.
Comment #5
cristiroma commentedWe found an issue with the following piece of code from the patch:
The problem is that the $node->language is ALWAYS the source language, not the current language. Thus pathauto will break the alias for english language.
Imagine the following scenario
1. Add new node in english (node/42)
url_alias is
481 | node/42 | articles/eeee | en
2. Add translation in romanian using "Add" from Translate tab. The table will look like this
482 | node/42 | articles/eeee | ro
481 | node/42 | articles/eeee | ro
So the english alias is lost., this is because path_load($conditions); will load the english alias instead of romanian one.
The proposed patch is to replace with
Note: Also having some double-thoughts about running this from command line, like "drush migrate-import" with translations ...
Comment #6
joel_osc commentedNot sure what you are saying about the patch, in it I remove the following lines:
Comment #7
cristiroma commentedYes, nevermind, was a little bit tired. Apologies for this mistake.
We just tested your patch and works perfectly :)
Comment #9
colanComment #10
colanForgot to set this up for forward porting.
Comment #11
das-peter commentedDoes not apply to the 2.x branch, it uses State Machine / State Flow and thus we don't have such code anymore.