You are here

function revisioning_rules_action_load_current in Revisioning 6.4

Same name and namespace in other branches
  1. 8 revisioning.rules.inc \revisioning_rules_action_load_current()
  2. 6.3 revisioning.rules.inc \revisioning_rules_action_load_current()
  3. 7 revisioning.rules.inc \revisioning_rules_action_load_current()

Action: load current revision of provided node.

File

./revisioning.rules.inc, line 231
Rules integration for Revisioning module.

Code

function revisioning_rules_action_load_current($node) {
  $current_vid = node_tools_get_current_node_revision_id($node->nid);
  if ($node->vid != $current_vid) {
    $current = node_load($node->nid, $current_vid);
    return array(
      'loaded_current_revision' => $current,
    );
  }
  return array(
    'loaded_current_revision' => $node,
  );
}