Issue #1715402 by mikeryan: Fixed Poor performance of _forum_update_forum_index() when passed a non-forum node.
parent
feac3940c3
commit
a967540ff1
|
@ -1328,7 +1328,7 @@ function _forum_get_topic_order($sortby) {
|
||||||
* The ID of the node to update.
|
* The ID of the node to update.
|
||||||
*/
|
*/
|
||||||
function _forum_update_forum_index($nid) {
|
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,
|
':nid' => $nid,
|
||||||
':status' => COMMENT_PUBLISHED,
|
':status' => COMMENT_PUBLISHED,
|
||||||
))->fetchField();
|
))->fetchField();
|
||||||
|
|
Loading…
Reference in New Issue