From 273a653f561bf96ce0ee4c88b7f59f5ce0d26f61 Mon Sep 17 00:00:00 2001
From: Dries Buytaert <dries@buytaert.net>
Date: Tue, 6 Mar 2007 16:15:19 +0000
Subject: [PATCH] - Patch #111830 by pwolanin: comment block sql incompatible
 with db_rewrite_sql.

---
 modules/comment/comment.module | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/comment/comment.module b/modules/comment/comment.module
index e0f6e9ccf586..104a0a4962e3 100644
--- a/modules/comment/comment.module
+++ b/modules/comment/comment.module
@@ -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)) {
-- 
GitLab