Skip to content
Snippets Groups Projects
Commit 29bfbf49 authored by Angie Byron's avatar Angie Byron
Browse files

Issue #1715402 by mikeryan: Fixed Poor performance of...

Issue #1715402 by mikeryan: Fixed Poor performance of _forum_update_forum_index() when passed a non-forum node.
parent db2f83b6
Branches
Tags
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -1359,7 +1359,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();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment