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.

CommentFileSizeAuthor
#4 i18ntaxonomy_sync_bug.patch651 bytessinasalek

Comments

Marc Bijl’s picture

Not sure, but this might have a relation with the issue here(?):

- http://drupal.org/node/367287

gregoiresan’s picture

Hi,

Same problem,

I'd love to know if someone get an answer !!??

Cheers

Greg

luco’s picture

hey. have you got "Synchronize translations" switched on in the modules page? worked for me...

sinasalek’s picture

Version: 6.x-1.1 » 6.x-1.0
StatusFileSize
new651 bytes

Same 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

sinasalek’s picture

Version: 6.x-1.0 » 6.x-1.1
Status: Active » Needs review
sinasalek’s picture

Version: 6.x-1.0 » 6.x-1.1
Status: Needs review » Needs work

Well, 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.

jose reyero’s picture

Status: Needs work » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.