Create node and copy fields

Events happening in the community are now at Drupal community events on www.drupal.org.
rulick's picture

I have two content types: Request and Response. When Request reaches a certain state in its Workflow, Response is created. At this point, some fields from the Request are copied to the Response. The field types include Integer, Text, File, Date and User Reference. I can see two potential solutions here:

1) Create a node of type Response and copy the field values there.
There is an Action that creates a Node. But I could not find an easy way to copy the field values into this new Node.

2) Clone Request and convert one of the copies into Response.
Node Convert module (http://drupal.org/project/node_convert) provides an action that converts one node type to another. But it does not clone the node before that. Is there a node_clone action?

Any other advice is appreciated.

Thanks in advance.

Comments

Use rules_forms

solide-echt's picture

Have you tried using the rules_forms submodule that comes along with rules? (it's a separate module). With this module you can hook into forms and have the default values of (cck-)fields in type Response set from the values in Request. I use this approach to populate fill fields based on the users content profile fields.

Hello.. I'm in the exact

sylvaticus's picture

Hello.. I'm in the exact situation of rulick (in my case are "space_request" types that, if accepted, geberate "event" nodes).
My doubt on your approach is that it's not a new node created but it is a change in the workflow status of an existing node.
Can you give me (us) a little bit more information on how to procede using the suggested approach ?? (sorry, I'm quite new with rules.. just pointing on some specific documentation would be appreciated!)

Recent comment

Itangalo's picture

Here's a very similar question, with a pretty good answer (if I may say so):
http://groups.drupal.org/node/75538#comment-235063

Cheers,
//Johan Falk, NodeOne, Sweden

Rules

Group organizers

Group categories

Categories

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: