Posted by szadok on April 15, 2010 at 9:39am
I would like to create the following rule (but without success so far):
I have 2 content types: idea & discussion.
In idea content type I have added a cck field named "status" (a select list) that has: registered, approved.
Here is the rule I want to have:
If node type is idea AND field "status" is approved
Then clone the node but with as type discussion.
Any ideas how to do that?
Thanks a lot,
S.
Comments
Anyone? ideas?
thoughts? rules? :-0
Thanks for the help
Tried doing something similar
I've tried doing something similar, but there is one important piece missing in my puzzle: When you create a new node with Rules, you don't get the nid back. (Saying that 'Rules doesn't give the nid back' is somewhat misleading -- it is the action that Rules uses that doesn't provide any nid result.)
I've asked a colleague to see if he can write an action, like 'Create a new node and then load it'. However, he won't have time to do this in reasonable time, so if anyone else is skilled in writing actions I'd be very happy.
IF you have such an action, what you want to do is the following:
I did a workaround for step 3, since I couldn't load the new node in any easy way. I included the 'old' nid in the new title, and then called a VBO that found the new node and performed a rule set on it. The rule set could then find both the new and the old node, and copy information between them.
This workaround is by all means a kludge and I don't recommend any one using it for real. I used it for a proof-of-concept, but it has many vulnerabilities and could destroy data if nodes by accident are cought by the VBO. However, if you're just interested in a proof-of-concept, it might work.
Those are my thought!
//Johan Falk, NodeOne, Sweden
Yes you can do this
I've just been playing with this as I wanted to do something similar.
The new node id becomes available as soon as you save it. So what you can do is:
I didn't need the node id so just copied the couple of fields I wanted in the new node using "Populate a field", taking the value from the original node using the appropriate field token. (If you do that you don't have to do the explicit save, though I can't see offhand how to copy the body, which I wasn't bothered about doing anyway.)
The fact that the new node id token works suggests that you can also get it in php but I just wanted to do something quick and dirty so didn't play around further.