Adding a translation creates a new node in the target language that is not properly tied to the original source node. Specifically, the source node’s tnid-field is not set, preventing the translated and the original version from showing up as localized version of the same content.

This finding is from one of the feedback (but he was using Workflow module instead).

Would this issue goes here or Rules/Workflow?

Comments

hass’s picture

Status: Active » Postponed (maintainer needs more info)

Please try out if this is fixed by http://drupal.org/cvs?commit=250744

zorp’s picture

I have the very same issue using workflow module, the moment I disable the workflow from my content type translation ties are save perfectly.

I have installed dev branch with the above mentioned fixes, but it is still the same issue... workflow module somehow kick in and prevent the new node from being tied to the source node. My workflow setting is simple unpublish, save post and publish, save post triggers.

digitaldonkey’s picture

Version: 6.x-1.x-dev » 6.x-1.4

Same Issue!

I switched the rule to "Content is going to be saved" which helps out of the worst.

Rob_Feature’s picture

Title: i18n failed with Rules that uses condition "After saving new content" » i18n tnid fails with Rules and saving content
Project: Internationalization » Rules
Version: 6.x-1.4 » 6.x-1.x-dev
Component: Code » Rules Engine
Category: support » bug
Priority: Normal » Major
Status: Postponed (maintainer needs more info) » Active

This is really a duplicate of #583666: workflow & i18n: when translating nodes, node are not binded together and really should probably be filed against the Rules module since the save action is part of rules, not workflow. Retitling, marking as major since it means we can't really use rules and i18n content translation together, and marking as bug report since it sure seems like this shouldn't be an issue.

Is this issue the same when using actions.module? (I haven't tested that)

fago’s picture

Status: Active » Postponed (maintainer needs more info)

I do not see what Rules should be doing wrong. Please explain.

Rob_Feature’s picture

Status: Postponed (maintainer needs more info) » Active

To see the problem follow these steps:

  1. Setup i18n and enable content translation.
  2. Setup Workflow module and create a pair of states: "review" and "published"
  3. Setup your workflow transitions using Rules module. Setup a rule that detects a workflow change and on that change you should do something like "if state change is from review to published" and then make the action be to publish the changed node (a common workflow setup)
  4. Then create a new node that is NOT language neutral (so you can translate it)...choose a language like English
  5. When that's created, click the 'translate' tab, then click 'add translation' next to any other language. When you do this it's creating a link between the node you came from and the new node you're creating. It does this by assigning a 'tnid' (translation node id, i think). So it should save that tnid when saving the new node
  6. When creating the new (translation) node, set the workflow to publish, which will fire our rule to publish the node
  7. Save the new node. Our rule fires here
  8. Now, on the new node, click the ''translate" tab. This should show our original node as one of the items this translation is linked to. It doesn't. This new node was not linked to it's original.
  9. Now turn OFF workflow for this node so the rule will no longer be firing
  10. Repeat the 'add translation' process for the original node...note that it works now because our rule isn't firing. This tell us the "unlinking" of translations is happening in rules

My testing shows that this is rules related, but at this point it COULD be workflow OR rules related because:

  • The original rule is checking workflow transition states, which is provided by workflow module. If it's breaking here, then it's a workflow issue
  • The node publish action is from Rules module, so if it's breaking here, it's a Rules issue

My testing (and another tester) are showing that it's probably happening during node save/publish which makes it a rules issue. I'm still open to it being a Workflow problem but not sure how to confirm that.

A note: The above steps seem like a lot which may lead anyone not using workflow and i18n regularly to think "this is really an edge case!" but it's not...the setup above is a pretty standard use of workflow and i18n...it just has alot of setup steps.

Anyone else care to chime in on this?

Rob_Feature’s picture

I just did some testing on a fresh install and am not getting this same issue. Hmmm....can anyone else confirm the problem of saving the relationship between translated content? It would be helpful to find a module that's causing this. (maybe not Rules?)

Rob_Feature’s picture

Just another note...this only happens during node insert, not during update. If you alter the workflow states after content is created, it stays linked to the original translation node.

Rob_Feature’s picture

Title: i18n tnid fails with Rules and saving content » i18n tnid fails with Workflow Rules and saving content
Project: Rules » Workflow
Component: Rules Engine » Code

Moving this issue over to Workflow module because I think I've confirmed that's where the problem is...it has something to do with the Workflow module's provided rules.

To determine this, I did this:

  1. Disabled all my existing workflow rules
  2. Created a new rule that ONLY did workflow stuff...so it detected a state change, then upon saving it moved the state to the next state (no practical use here, just wanted ALL rules to be from workflow module). This failed to save the translation linkage
  3. At this point it still could have been a Rules.module issue, in theory, because we're using rules to do the actions...so...
  4. I setup a new rule (Disabling the last one) in which NO workflow stuff was in there...just all core Rules.module rules and actions. When creating the translations I had no problems

So, the common denominator between my 'real life' rules and my test rules that failed was the Workflow module rule: "workflow state has changed". I believe this is where the problem lies....

Note that this still doesnt account for a previous comment where I found that this didn't happen on a fresh installation...that has me really stumped, and I'd love to hear other people's results

nw’s picture

I was seeing a similar problem with Workflow, Translation & Trigger (not i18n nor rules) in a 6.19 site. I found that an upgrade of core fixed this. In particular, the fix is in #357785 "retain the tnid value for new nodes saved, so the node object reflects the database" which was committed (into 6.20) on Wed, 15 Dec 2010.

--- a/modules/translation/translation.module
+++ b/modules/translation/translation.module
@@ -227,6 +227,7 @@ function translation_nodeapi(&$node, $op, $teaser, $page) {
db_query("UPDATE {node} SET tnid = %d, translate = %d WHERE nid = %d", $tnid, 0, $node->translation_source->nid);
}
db_query("UPDATE {node} SET tnid = %d, translate = %d WHERE nid = %d", $tnid, 0, $node->nid);
+ $node->tnid = $tnid;
}
break;

Rob_Feature’s picture

Status: Active » Closed (works as designed)

Confirmed that this was fixed by upgrading to a version of drupal past 6.20 (found the site I was using was on 6.18). Closing this issue, marking as 'works as designed'