Hi,
following scenario: I want users to flag a node from content type "service" to place an order in this way. The order will be a new node from content type "order" created with Rules module. The rule is triggered by "flagging content under ORDER THIS". The services will be nodes translated in English and German and a user should not be able to order a service twice so there is a need to flag this translated content as a group.
Now I realized that always just one node will be saved as flagged. But the rule should takeover some of the fields of the "service" content type to the order node, e.g. price and service description. The flagged service node should also be saved in a nodereference field of the order. I understand that flag just really flags one node but in this way for example an English user flags a German node - which leads 1.) to an error message as for example German (service-) nodes cannot be saved in nodereference field of English (order-) nodes and 2.) leads to a German description of the service in an English order.
So my question now is: is there a way to get the tnid of the right language service-node in rules in order to get the field values of this English or German service description and the tnid of this node in the right language for the nodereference field? Has anyone an idea???
I though of something like the following:
- $node is a variable still existing for the flagged content
- $new_order is a variable still existing for the new created order node
- There would be needed a way to check the language of $node against the language of $new_order (which I think I would get).
- But than there would be needed a way to load the service node of the right tnid if the language do not match
- And than to get the fields of this service node for the newly created node.
I already tried different ways but find no solution. To check the languages I used a snippet with
$translations = translation_node_get_translations($node->tnid);
Greez,
Tobias
Comments
Comment #1
tobiberlinMay this be connected to "Rules incompatible with Content translation core module" (http://drupal.org/node/485280), where it is mentioned that there might be a problem with translation.module (http://drupal.org/node/858136) - the point is that I printed out the variables by a "Show a message on Website" action by
for example for the flagged content - and I wondered why $tnid had the same value as $nid...
Comment #2
tr commented