Closed (fixed)
Project:
Rules
Version:
7.x-2.0-rc2
Component:
Rules Engine
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
19 Sep 2011 at 21:28 UTC
Updated:
16 Oct 2011 at 20:31 UTC
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
Comment #1
AABoyles commentedComment #2
AABoyles commentedUpdate: 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.
Comment #3
itangalo commentedThis 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).