You are here

function revisioning_rules_action_load_current in Revisioning 7

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

Action: load current revision of provided node.

File

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

Code

function revisioning_rules_action_load_current($node) {

  // Or revisioning_get_current_node_revision_id($node->nid); ?
  $current_vid = $node->current_revision_id;
  if ($node->vid != $current_vid) {
    $current = node_load($node->nid, $current_vid);
    return array(
      'loaded_current_revision' => $current,
    );
  }
  return array(
    'loaded_current_revision' => $node,
  );
}