Commit baa2ecc8 authored by Dries's avatar Dries

- Patch #47045 by Cvbge: fixed problem with deleting comments.

parent a6dac9d2
......@@ -1695,7 +1695,8 @@ function _comment_update_node_statistics($nid) {
// no comments
else {
db_query("UPDATE {node_comment_statistics} SET comment_count = 0, last_comment_timestamp = created, last_comment_name = '', last_comment_uid = uid FROM {node} WHERE {node_comment_statistics}.nid = {node}.nid AND {node}.nid = %d", $nid);
$node = db_fetch_object(db_query("SELECT uid, created FROM {node} WHERE nid = %d", $nid));
db_query("UPDATE {node_comment_statistics} SET comment_count = 0, last_comment_timestamp = %d, last_comment_name = '', last_comment_uid = %d WHERE nid = %d", $node->created, $node->uid, $nid);
}
}
......
......@@ -1695,7 +1695,8 @@ function _comment_update_node_statistics($nid) {
// no comments
else {
db_query("UPDATE {node_comment_statistics} SET comment_count = 0, last_comment_timestamp = created, last_comment_name = '', last_comment_uid = uid FROM {node} WHERE {node_comment_statistics}.nid = {node}.nid AND {node}.nid = %d", $nid);
$node = db_fetch_object(db_query("SELECT uid, created FROM {node} WHERE nid = %d", $nid));
db_query("UPDATE {node_comment_statistics} SET comment_count = 0, last_comment_timestamp = %d, last_comment_name = '', last_comment_uid = %d WHERE nid = %d", $node->created, $node->uid, $nid);
}
}
......
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