0

I currently have an "Event" content type with a webform attached to each event. The webforms use the conditional confirmation message module to display different confirmation messages depending on the input to the form. I'm using the node clone module to duplicate events and everything works well expect that the conditional confirmation messages are not being duplicated. What should I do so that every part of the event node (including the conditional confirmation messages) is duplicated?

2
  • The conditional confirmation messages seems to be not part of the node (field or node object property) so It won't be considered part of the node and not duplicated Commented May 31, 2015 at 9:42
  • Would it be possible in any way to achieve the desired behavior? Commented May 31, 2015 at 15:15

1 Answer 1

0

The node clone module gives you the tools to make this happen. You can have a custom module make use of hook_node_clone_alter then use the Webform Conditional Confirmation module's functions to load & copy the original messages, store them temporarily, then save them upon saving the newly cloned node.

Something like this...

function MYMODULE_clone_node_alter(&$node, $context) {
  $messages = webform_conditional_confirmation_message_load($node->clone_from_original_nid);
  foreach($messages as $msg_id => $message) {
    //@TODO: Store in some temporary spot until cloned node is saved
  }
}

function MYMODULE_node_update($node) {
  //@TODO: Retrieve messages from temp location and place into $messages
  foreach($messages as $msg_id => $message) {
    $message->nid = $node->nid;
    webform_conditional_confirmation_message_save($message);
  }
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.