summaryrefslogtreecommitdiff
path: root/modules/comment/comment.module
diff options
context:
space:
mode:
Diffstat (limited to 'modules/comment/comment.module')
-rw-r--r--modules/comment/comment.module26
1 files changed, 10 insertions, 16 deletions
diff --git a/modules/comment/comment.module b/modules/comment/comment.module
index d103e3a2d..2143e49e8 100644
--- a/modules/comment/comment.module
+++ b/modules/comment/comment.module
@@ -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;
}
}