You are here

function revision_deletion_delete_rev in Revision Deletion 5

Same name and namespace in other branches
  1. 6 revision_deletion.module \revision_deletion_delete_rev()

Implementation of revision_deletion_delete_rev(). Borrows heavily from the node.module api function to delete revisions, with some of the checks and messages removed. No check to make sure we are not deleting the current node revision. That is covered in the function that creates the data set.

2 calls to revision_deletion_delete_rev()
revision_deletion_cron in ./revision_deletion.module
Implementation of hook_cron().
revision_deletion_list_form_submit in ./revision_deletion.module
Handle submission of form to list all revisions of a node.

File

./revision_deletion.module, line 433
Node Revision Deletion, written by Greg Holsclaw

Code

function revision_deletion_delete_rev($data = NULL) {
  $node = node_load($data->nid, $data->vid);
  db_query("DELETE FROM {node_revisions} WHERE nid = %d AND vid = %d", $data->nid, $data->vid);
  node_invoke_nodeapi($node, 'delete revision');
  watchdog('Revision Deletion', t('@type: node @nid, deleted %title, revision @revision.', array(
    '@type' => $node->type,
    '%title' => $node->title,
    '@nid' => $data->nid,
    '@revision' => $data->vid,
  )));
}