From a967540ff1aad558379d96fca96e1c11206710da Mon Sep 17 00:00:00 2001 From: webchick Date: Sat, 18 Aug 2012 14:05:41 +0200 Subject: Issue #1715402 by mikeryan: Fixed Poor performance of _forum_update_forum_index() when passed a non-forum node. --- modules/forum/forum.module | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules/forum') diff --git a/modules/forum/forum.module b/modules/forum/forum.module index 7e8d81bde..80832331b 100644 --- a/modules/forum/forum.module +++ b/modules/forum/forum.module @@ -1328,7 +1328,7 @@ function _forum_get_topic_order($sortby) { * The ID of the node to update. */ function _forum_update_forum_index($nid) { - $count = db_query('SELECT COUNT(cid) FROM {comment} WHERE nid = :nid AND status = :status', array( + $count = db_query('SELECT COUNT(cid) FROM {comment} c INNER JOIN {forum_index} i ON c.nid = i.nid WHERE c.nid = :nid AND c.status = :status', array( ':nid' => $nid, ':status' => COMMENT_PUBLISHED, ))->fetchField(); -- cgit v1.2.3