I have one content type with a multi-value field collection entity on it.
On the event that this content type is flagged I would like to fire a rule that will create a new piece of content and copy all of the field collection lines to the same field collection type on the new content type.
The rule I have included bellow fires and creates the new content however the field collection is not copied.
{ "rules_generate_pal" : {
"LABEL" : "Generate PAL",
"PLUGIN" : "reaction rule",
"REQUIRES" : [ "rules", "flag" ],
"ON" : [ "flag_flagged_generate_pal" ],
"IF" : [
{ "entity_has_field" : {
"entity" : [ "flagged-node" ],
"field" : "field_project_personnel_needed"
}
}
],
"DO" : [
{ "entity_create" : {
"USING" : {
"type" : "node",
"param_type" : "project_activity_log",
"param_title" : "[site:current-date]",
"param_author" : [ "flagging-user" ]
},
"PROVIDE" : { "entity_created" : { "entity_created_pal" : "Created PAL" } }
}
},
{ "drupal_message" : { "message" : "BOOM!" } },
{ "LOOP" : {
"USING" : { "list" : [ "flagged-node:field-project-personnel-needed" ] },
"ITEM" : { "list_item" : "Current list item" },
"DO" : [
{ "list_add" : {
"list" : [ "entity-created-pal:field-project-personnel-needed" ],
"item" : [ "flagged-node:field-project-personnel-needed:0" ]
}
}
]
}
}
]
} }