Commit dd572569 authored by webchick's avatar webchick

#890790 by moshe weitzman: Fixed deleting nodes does not delete their comments.

parent 7fcde37a
......@@ -1138,16 +1138,6 @@ function node_delete_multiple($nids) {
if (!empty($nids)) {
$nodes = node_load_multiple($nids, array());
db_delete('node')
->condition('nid', $nids, 'IN')
->execute();
db_delete('node_revision')
->condition('nid', $nids, 'IN')
->execute();
db_delete('history')
->condition('nid', $nids, 'IN')
->execute();
foreach ($nodes as $nid => $node) {
// Call the node-specific callback (if any):
node_invoke($node, 'delete');
......@@ -1163,6 +1153,17 @@ function node_delete_multiple($nids) {
}
}
// Delete after calling hooks so that they can query node tables as needed.
db_delete('node')
->condition('nid', $nids, 'IN')
->execute();
db_delete('node_revision')
->condition('nid', $nids, 'IN')
->execute();
db_delete('history')
->condition('nid', $nids, 'IN')
->execute();
// Clear the page and block and node_load_multiple caches.
cache_clear_all();
entity_get_controller('node')->resetCache();
......
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