When editing a node's category that belongs to a translation (taxonomy sync enabled with Per language terms), the node's translations are updated with the node's tid instead of their language specific one.
The problem happens in i18ntaxonomy_translate_terms (i18ntaxonomy.module: 648). On line 652 it checks whether the term language of the source node is different than the language of the node to be synced and then proceeds to get the translated tid.
Now what happens is that the term language is missing altogether ($taxonomy only contains the source node's tids), thus the function assumes that there are no term translations and uses the source tid for all translations instead.
Solution: The $node variable that's passed to i18nsync_taxonomyfield(&$node, $source) should first be populated with the full term data. However, a simple $node = node_load($node->tid) won't work because then we'd get the old data sitting in the db and not the one that has just been posted.
I hope someone more familiar with i18n than me can address this issue. Thanks.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | i18ntaxonomy_sync_bug.patch | 651 bytes | sinasalek |
Comments
Comment #1
Marc Bijl commentedNot sure, but this might have a relation with the issue here(?):
- http://drupal.org/node/367287
Comment #2
gregoiresan commentedHi,
Same problem,
I'd love to know if someone get an answer !!??
Cheers
Greg
Comment #3
luco commentedhey. have you got "Synchronize translations" switched on in the modules page? worked for me...
Comment #4
sinasalek commentedSame problem here, the cause of this problem is exactly drimsun explained. first i thought that it might be a conflict but after disabling all other modules i'm almost sure that it's a bug.
Here is the patch , please try and let me know if it worked for your.
Instead of populating $tids in i18nsync_taxonomyfield, i prepared a patch for i18ntaxonomy_translate_terms , it can now accept both number and object terms. i'm not sure but this patch might fix some other issues with taxonomy in issue queue
Comment #5
sinasalek commentedComment #6
sinasalek commentedWell, it seems that i18n taxonomy synchronization feature has several other issues as well. It's unable to sync tags vocabulary and probably all other kind of vocabularies. it requires more investigation and a bigger patch. but if your only problem is with the simple vocabularies the #4 patch should work for u.
Comment #7
jose reyero commentedThe patch in #4 is good but incomplete. See #379306: Synchronize translations for taxonomy terms not working (content type setting)