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

- Patch #111830 by pwolanin: comment block sql incompatible with db_rewrite_sql.

parent 1e9c5177
No related branches found
No related tags found
No related merge requests found
......@@ -256,7 +256,7 @@ function comment_get_recent($number = 10) {
// Select the $number nodes (visible to the current user) with the most
// recent comments. This is efficient due to the index on
// last_comment_timestamp.
$result = db_query_range(db_rewrite_sql("SELECT n.nid FROM {node_comment_statistics} n WHERE n.comment_count > 0 ORDER BY n.last_comment_timestamp DESC"), 0, $number);
$result = db_query_range(db_rewrite_sql("SELECT nc.nid FROM {node_comment_statistics} nc WHERE nc.comment_count > 0 ORDER BY nc.last_comment_timestamp DESC", 'nc'), 0, $number);
$nids = array();
while ($row = db_fetch_object($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