The rules module it's not working with Content translation core module. When the rule module is triggered you lose the relationship between the different nodes that define a content translation.
How to reproduce:
1. Enable rules, locale and Content translation.
2. Enable two or more languages in (.../admin/settings/language)
2. Create a rule that change any story node from unpublished to published
3. Create a story node with unpublished state.
--> OK! The node is created and rules is triggered and the state changed.
4. Open your new node and translate to another language (...node/XXX/translate)
--> Fail! The node is created and published but it's created as a new node, not as a translation of the first node! The new node has lost the translation_source.
All node translations have a tnid in the {node} table and rules module lost the tnid when change or create a node.
Comments
Comment #1
fagoOh, that sounds bad, however I don't think rules is really the problem here - is it does nothing more than using the provided API for saving the node. So I wonder, does this also happen when you manually publish the node? Which event are you using for publishing it?
Comment #2
matteoraggi commentedI'm publishing roles here on registration page, and I'm using the module user_selectable_roles
http://www.forniture-alberghiere.net/en/user/register
Comment #3
rapsli commentedexperiencing this same problem... I'm having a look at it
Comment #4
rapsli commentedOky. Here is my testrule that doesn't work with content translation. Steps.
- create page in language
- add translation
- rules is triggered
- node (the translated version) is being published -> updates the node table and overrides the tnid.
Comment #5
fagoWhat rules does with the node is just issuing a programmatic "node_save()". This shouldn't pose any troubles though. But maybe try the event before content is saved and see whether it works that way.
Comment #6
rapsli commentedseems to be a Drupal core bug:
translation.module, translation_nodeapi()
$tnid is not being added to the node object. When later on rules is doing some stuff to the node object and saving the nodeobject the tnid is set to null and overwrites the the tnid again that was set by the translation module.
Put this into drupal core
#858136: tnid not being added to the node object