At the moment it does a raw db_update() which means any code relying on comment hooks is out of luck.

CommentFileSizeAuthor
#7 814884.patch1.61 KBcatch
#4 814884.patch1.57 KBcatch
#2 814884.patch1.57 KBcatch
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

catch’s picture

Status: Active » Needs review

There's an additional bug - when the comments are unpublished, the last_comment_uid should fall back to the uid of the most recent published node, not 0.

Either way this patch changes it to do a comment_load_multiple() then comment_save(). It does not implement batch API due to the various issues discussed in #89181: Use queue API for node and comment, user, node multiple deletes - neither queue, nor batch, nor neither are good options.

catch’s picture

FileSize
1.57 KB
sun’s picture

Status: Needs review » Needs work
+++ modules/comment/comment.module	1 Jun 2010 15:10:42 -0000
@@ -1323,25 +1323,19 @@ function comment_node_search_result($nod
+      $comments = comment_load_multiple(array(), array('cid' => $account->uid));
...
+      $comments = comment_load_multiple(array(), array('cid' => $account->uid));

s/cid/uid/

79 critical left. Go review some!

catch’s picture

Status: Needs work » Needs review
FileSize
1.57 KB

Shocking.

catch’s picture

Title: coment_user_cancel() should use comment_save() » comment_user_cancel() should use comment_save()
moshe weitzman’s picture

Status: Needs review » Needs work

$comment->status = 0;

should be COMMENT_PUBLISHED

catch’s picture

Status: Needs work » Needs review
FileSize
1.61 KB

COMMENT_NOT_PUBLISHED but yes. Also added DRUPAL_ANONYMOUS_RID while I was in there.

Dries’s picture

Status: Needs review » Fixed

I can't see anything wrong with this patch. Committed to CVS HEAD. Thanks.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.