Commit bf22ca02 authored by Dries's avatar Dries
Browse files

- Patch #814884 by catch: comment_user_cancel() should use comment_save().

parent c1929c6c
......@@ -1323,25 +1323,19 @@ function comment_node_search_result($node) {
function comment_user_cancel($edit, $account, $method) {
switch ($method) {
case 'user_cancel_block_unpublish':
db_update('comment')
->fields(array('status' => 0))
->condition('uid', $account->uid)
->execute();
db_update('node_comment_statistics')
->fields(array('last_comment_uid' => 0))
->condition('last_comment_uid', $account->uid)
->execute();
$comments = comment_load_multiple(array(), array('uid' => $account->uid));
foreach ($comments as $comment) {
$comment->status = 0;
comment_save($comment);
}
break;
case 'user_cancel_reassign':
db_update('comment')
->fields(array('uid' => 0))
->condition('uid', $account->uid)
->execute();
db_update('node_comment_statistics')
->fields(array('last_comment_uid' => 0))
->condition('last_comment_uid', $account->uid)
->execute();
$comments = comment_load_multiple(array(), array('uid' => $account->uid));
foreach ($comments as $comment) {
$comment->uid = 0;
comment_save($comment);
}
break;
}
}
......
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