You are here

function node_node_revision_operation_revert in Revision scheduler 7

Node revision operation callback: revert to revision.

1 string reference to 'node_node_revision_operation_revert'
node_entity_revision_operation_info in ./revision_scheduler.module
Implements hook_entity_revision_operation_info() on behalf of node.module.

File

./revision_scheduler.module, line 857

Code

function node_node_revision_operation_revert($node) {
  $node->revision = 1;
  $node->log = t('Copy of the revision from %date.', array(
    '%date' => format_date($node->revision_timestamp),
  ));
  node_save($node);
  drupal_set_message(t('@type %title has been reverted back to the revision from %revision-date.', array(
    '@type' => node_type_get_name($node),
    '%title' => $node->title,
    '%revision-date' => format_date($node->revision_timestamp),
  )));
}