Skip to content
Snippets Groups Projects
Commit 87f5947e authored by Dries Buytaert's avatar Dries Buytaert
Browse files

- Patch #47868 by wtanaka: performance improvement: active topics block selects an unused column.

parent 91e152b8
No related branches found
No related tags found
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
......@@ -371,7 +371,7 @@ function forum_block($op = 'list', $delta = 0, $edit = array()) {
switch ($delta) {
case 0:
$title = t('Active forum topics');
$sql = db_rewrite_sql("SELECT n.nid, n.title, l.last_comment_timestamp, l.comment_count FROM {node} n INNER JOIN {node_comment_statistics} l ON n.nid = l.nid WHERE n.status = 1 AND n.type = 'forum' ORDER BY l.last_comment_timestamp DESC");
$sql = db_rewrite_sql("SELECT n.nid, n.title, l.comment_count FROM {node} n INNER JOIN {node_comment_statistics} l ON n.nid = l.nid WHERE n.status = 1 AND n.type = 'forum' ORDER BY l.last_comment_timestamp DESC");
$result = db_query_range($sql, 0, variable_get('forum_block_num_0', '5'));
if (db_num_rows($result)) {
$content = node_title_list($result);
......
......@@ -371,7 +371,7 @@ function forum_block($op = 'list', $delta = 0, $edit = array()) {
switch ($delta) {
case 0:
$title = t('Active forum topics');
$sql = db_rewrite_sql("SELECT n.nid, n.title, l.last_comment_timestamp, l.comment_count FROM {node} n INNER JOIN {node_comment_statistics} l ON n.nid = l.nid WHERE n.status = 1 AND n.type = 'forum' ORDER BY l.last_comment_timestamp DESC");
$sql = db_rewrite_sql("SELECT n.nid, n.title, l.comment_count FROM {node} n INNER JOIN {node_comment_statistics} l ON n.nid = l.nid WHERE n.status = 1 AND n.type = 'forum' ORDER BY l.last_comment_timestamp DESC");
$result = db_query_range($sql, 0, variable_get('forum_block_num_0', '5'));
if (db_num_rows($result)) {
$content = node_title_list($result);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment