If a comment is added to a node, a new record is automatically inserted in the comment_notify table (so far it's all OK). However if the comment is deleted, the record from comment_notify is not removed. I suspect that these records are of no further use, thus they could be deleted.

Adding a "delete" handler to the end of the comment_notify_comment() hook implementation could do this:

<?php
function comment_notify_comment($comment, $op) {
 
// (...)
 
switch ($op) {
   
// (...)
    // add this to the end
   
case 'delete':
     
$sql = 'DELETE FROM {comment_notify} WHERE cid = %d';
     
db_query($sql, $comment->cid);
      break;
  }
}
?>

Comments

Priority:Minor» Normal
Status:Active» Needs review
StatusFileSize
new1.62 KB
new1.72 KB

Great point.

We should also sync it up in an update function.

Can you test out this patch?

Status:Needs review» Fixed

This is now fixed.

Thanks for the report müzso!

Status:Fixed» Closed (fixed)

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