From 91824358be16f8e5bfbdba6f14d9e588ef0cbc3b Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Thu, 10 Apr 2008 01:45:38 +0000 Subject: [PATCH] - Patch #216504 by webchick et al: added missing table alias in comment_render function. --- modules/comment/comment.module | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/comment/comment.module b/modules/comment/comment.module index c72dd2b8e2f..0633d623d06 100644 --- a/modules/comment/comment.module +++ b/modules/comment/comment.module @@ -976,13 +976,13 @@ function comment_render($node, $cid = 0) { } else { // Multiple comment view - $query_count = 'SELECT COUNT(*) FROM {comments} WHERE nid = %d'; + $query_count = 'SELECT COUNT(*) FROM {comments} c WHERE c.nid = %d'; $query = 'SELECT c.cid as cid, c.pid, c.nid, c.subject, c.comment, c.format, c.timestamp, c.name, c.mail, c.homepage, u.uid, u.name AS registered_name, u.signature, u.picture, u.data, c.thread, c.status FROM {comments} c INNER JOIN {users} u ON c.uid = u.uid WHERE c.nid = %d'; $query_args = array($nid); if (!user_access('administer comments')) { $query .= ' AND c.status = %d'; - $query_count .= ' AND status = %d'; + $query_count .= ' AND c.status = %d'; $query_args[] = COMMENT_PUBLISHED; }