array ( 'rules' => array ( 'rules_14' => array ( '#type' => 'rule', '#set' => 'rules_terms_copy_to_reference', '#label' => 'Load referenced node, copy terms', '#active' => 1, '#weight' => '0', '#categories' => array ( 0 => 'taxonomy_copy', ), '#status' => 'custom', '#conditions' => array ( 0 => array ( '#negate' => 1, '#weight' => 0, '#info' => array ( 'label' => 'Reference is (not) empty', 'label callback' => false, 'arguments' => array ( 'node' => array ( 'type' => 'node', 'label' => 'Content', ), ), 'eval input' => array ( 0 => 'code', 1 => 'value|0|nid', ), 'module' => 'CCK', ), '#name' => 'content_rules_field_has_value', '#settings' => array ( 'field_name' => 'field_pagereference', '#argument map' => array ( 'node' => 'node', ), 'value' => array ( 0 => array ( 'nid' => '', ), ), 'code' => '', 'vars' => array ( ), ), '#type' => 'condition', ), ), '#actions' => array ( 0 => array ( '#type' => 'action', '#settings' => array ( 'field' => 'field_pagereference', '#argument map' => array ( 'node' => 'node', 'referenced_node' => 'referenced_node', ), ), '#name' => 'nodereference_rules_action_load', '#info' => array ( 'label' => 'Load the referenced node', 'label callback' => false, 'arguments' => array ( 'node' => array ( 'type' => 'node', 'label' => 'Content containing the node reference field', ), ), 'new variables' => array ( 'referenced_node' => array ( 'type' => 'node', 'label' => 'Referenced content', ), ), 'module' => 'CCK', ), '#weight' => 0, ), 1 => array ( '#weight' => 0, '#info' => array ( 'label' => 'PHP: copy taxonomy terms to referenced node', 'label callback' => false, 'module' => 'PHP', 'eval input' => array ( 0 => 'code', ), ), '#name' => 'rules_action_custom_php', '#settings' => array ( 'code' => '// Loop through all taxonomy terms in the source node foreach ($node->taxonomy as $tid => $termdata) { // If the term isn\'t already present in target node, add it if (!isset($referenced_node->taxonomy[$tid])) { $referenced_node->taxonomy[$tid] = $termdata; } } // Tell Rules to save the variable $referenced_node return array("referenced_node" => $referenced_node);', 'vars' => array ( 0 => 'referenced_node', 1 => 'node', ), ), '#type' => 'action', ), 2 => array ( '#type' => 'action', '#settings' => array ( 'message' => 'Terms from [node:title] were copied to [referenced_node:title].', 'error' => 0, '#eval input' => array ( 'token_rules_input_evaluator' => array ( 'message' => array ( 0 => 'referenced_node', 1 => 'node', ), ), ), ), '#name' => 'rules_action_drupal_message', '#info' => array ( 'label' => 'Show a configurable message on the site', 'module' => 'System', 'eval input' => array ( 0 => 'message', ), ), '#weight' => 0, ), ), '#version' => 6003, ), 'rules_15' => array ( '#type' => 'rule', '#set' => 'event_node_presave', '#label' => 'On story save, copy taxonomy terms from node to referenced node', '#active' => 1, '#weight' => '0', '#categories' => array ( 0 => 'taxonomy_copy', ), '#status' => 'custom', '#conditions' => array ( 0 => array ( '#weight' => 0, '#info' => array ( 'label' => 'Saved content is Story', 'arguments' => array ( 'node' => array ( 'type' => 'node', 'label' => 'Content', ), ), 'module' => 'Node', ), '#name' => 'rules_condition_content_is_type', '#settings' => array ( 'type' => array ( 'story' => 'story', ), '#argument map' => array ( 'node' => 'node', ), ), '#type' => 'condition', ), ), '#actions' => array ( 0 => array ( '#type' => 'action', '#settings' => array ( '#argument map' => array ( 'node' => 'node', ), ), '#name' => 'rules_action_invoke_set_rules_terms_copy_to_reference', '#info' => array ( 'arguments' => array ( 'node' => array ( 'label' => 'Original content', 'type' => 'node', ), ), 'label' => 'Copy taxonomy terms from node to referenced node', 'status' => 'custom', 'categories' => array ( ), 'module' => 'Rule Sets', 'base' => 'rules_action_invoke_set', 'set' => 'rules_terms_copy_to_reference', ), '#weight' => 0, ), ), '#version' => 6003, ), ), 'rule_sets' => array ( 'rules_terms_copy_to_reference' => array ( 'arguments' => array ( 'node' => array ( 'label' => 'Original content', 'type' => 'node', ), ), 'label' => 'Copy taxonomy terms from node to referenced node', 'status' => 'custom', 'categories' => array ( 0 => 'taxonomy_copy', ), ), ), )