You are here

function revisioning_events_argument_current_revision in Revisioning 8

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

Evaluate revision argument.

1 string reference to 'revisioning_events_argument_current_revision'
_revisioning_rules_event_variables in ./revisioning.rules.inc
Returns event variables suitable for use with a node revision event.

File

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

Code

function revisioning_events_argument_current_revision($arguments, $name, $info) {
  if (empty($arguments['node'])) {
    drupal_set_message(t('Revisioning: could not evaluate rule condition -- node variable missing.'), 'warning');
    return FALSE;
  }
  $node = $arguments['node'];

  // Use 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 $current;
  }
  return $node;
}