summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2010-06-02 06:20:11 +0000
committerDries Buytaert <dries@buytaert.net>2010-06-02 06:20:11 +0000
commitbf22ca024a0565643b70dd3eb381559a5d44a3af (patch)
treefd0c144bbca68d2a620afbd12ba24f959682a1d0
parentc1929c6c1ef54529667d7b0efaeca4b707af38ef (diff)
downloadbrdo-bf22ca024a0565643b70dd3eb381559a5d44a3af.tar.gz
brdo-bf22ca024a0565643b70dd3eb381559a5d44a3af.tar.bz2
- Patch #814884 by catch: comment_user_cancel() should use comment_save().
-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;
}
}