Commit 09572488 authored by greggles's avatar greggles

bug #297791 by greggles: deleted comments are not deleted from comment_notify

parent ac9f37a6
......@@ -47,4 +47,12 @@ function comment_notify_schema() {
'notify_hash' => array('notify_hash')),
);
return $schema;
}
/**
* Sync up the two tables after as part of http://drupal.org/node/297791
*/
function comment_notify_update_6000() {
$return[] = update_sql("DELETE FROM {comment_notify} WHERE cid NOT IN (SELECT cid FROM {comments})");
return $return;
}
\ No newline at end of file
......@@ -229,6 +229,9 @@ function comment_notify_comment($comment, $op) {
// And then save the data.
db_query("INSERT INTO {comment_notify} (cid, notify, notify_hash) values (%d, %d, '%s')", $comment['cid'], $comment['notify'], md5($md5_string));
break;
case 'delete':
db_query("DELETE FROM {comment_notify} WHERE cid = %d", $comment->cid);
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