My rule runs when a new node of a particular type is created, and it (the rule) then creates another node of a different type and link it to the originally created node. Now I want the rule to set the data value of a field within the original node to point to the node that the rule created (i.e., have node references pointing both directions), but it consistently fails: I don't get any errors, but the rule simply doesn't set the node reference. Any suggestions?

Comments

AABoyles’s picture

Component: Rules Core » Rules Engine
Assigned: AABoyles » Unassigned
AABoyles’s picture

Update: If anyone else has this problem, I couldn't find a solution to the issue in rules, but I added a circular node reference (which rules could set without a problem), and then used the Corresponding Node References module, which more-or-less solved the problem.

itangalo’s picture

Status: Active » Fixed

This problem appears if you use the event "content is going to be save" instead of "new content has been created". In the former case, the node has not yet been saved, and hasn't gotten any node ID yet – so creating the reference will fail.

You could try just outputting the node ID in a message to check whether this is the case (or use the Devel module's action for inspecting data).

Status: Fixed » Closed (fixed)

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