diff options
author | webchick <webchick@24967.no-reply.drupal.org> | 2012-08-18 14:05:41 +0200 |
---|---|---|
committer | webchick <webchick@24967.no-reply.drupal.org> | 2012-08-18 14:05:41 +0200 |
commit | a967540ff1aad558379d96fca96e1c11206710da (patch) | |
tree | 79af2dbe6e6ae376e8465f48b7fb50ffe8d5d2f2 /modules/forum | |
parent | feac3940c31baace6acf444a2a38284a1c8d32cd (diff) | |
download | brdo-a967540ff1aad558379d96fca96e1c11206710da.tar.gz brdo-a967540ff1aad558379d96fca96e1c11206710da.tar.bz2 |
Issue #1715402 by mikeryan: Fixed Poor performance of _forum_update_forum_index() when passed a non-forum node.
Diffstat (limited to 'modules/forum')
-rw-r--r-- | modules/forum/forum.module | 2 |
1 files changed, 1 insertions, 1 deletions
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(); |