From dde80e874b756975dc9e568ead500fec70af56d0 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Sun, 29 Nov 2009 10:33:16 +0000 Subject: - Patch #642178 by mfb: fixed two comment updates bug. --- modules/tracker/tracker.module | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'modules/tracker/tracker.module') diff --git a/modules/tracker/tracker.module b/modules/tracker/tracker.module index ebf2370a3..8b011ed66 100644 --- a/modules/tracker/tracker.module +++ b/modules/tracker/tracker.module @@ -191,11 +191,10 @@ function tracker_node_delete($node, $arg = 0) { * comments so we need to check for those here. */ function tracker_comment_update($comment) { - $comment = (array) $comment; // comment_save() calls hook_comment_publish() for all published comments // so we to handle all other values here. - if ($comment['status'] != COMMENT_PUBLISHED) { - _tracker_remove($comment['nid'], $comment['uid'], $comment['timestamp']); + if ($comment->status != COMMENT_PUBLISHED) { + _tracker_remove($comment->nid, $comment->uid, $comment->changed); } } @@ -309,9 +308,10 @@ function _tracker_remove($nid, $uid = NULL, $changed = NULL) { // Comments are a second reason to keep the user's subscription. if (!$keep_subscription) { // Check if the user has commented at least once on the given nid - $keep_subscription = db_query_range('SELECT COUNT(*) FROM {comment} WHERE nid = :nid AND uid = :uid AND status = 0', 0, 1, array( + $keep_subscription = db_query_range('SELECT COUNT(*) FROM {comment} WHERE nid = :nid AND uid = :uid AND status = :status', 0, 1, array( ':nid' => $nid, ':uid' => $uid, + ':status' => COMMENT_PUBLISHED, ))->fetchField(); } -- cgit v1.2.3