Commit 10931908 authored by Dries's avatar Dries

- Patch #318496 by DeeLay: node_delete does not clean up history.

parent 01a33182
......@@ -1165,8 +1165,15 @@ function node_delete($nid) {
$node = node_load($nid);
if (node_access('delete', $node)) {
db_query('DELETE FROM {node} WHERE nid = %d', $node->nid);
db_query('DELETE FROM {node_revision} WHERE nid = %d', $node->nid);
db_delete('node')
->condition('nid', $node->nid)
->execute();
db_delete('node_revision')
->condition('nid', $node->nid)
->execute();
db_delete('history')
->condition('nid', $node->nid)
->execute();
// Call the node-specific callback (if any):
node_invoke($node, 'delete');
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment