summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2008-04-10 01:45:38 +0000
committerDries Buytaert <dries@buytaert.net>2008-04-10 01:45:38 +0000
commit91824358be16f8e5bfbdba6f14d9e588ef0cbc3b (patch)
treeb64ed4670cd0163e9a27f694828deb2c746d3faf
parent2275b8ee02938c53e7b02707b08e9a71a1262cf1 (diff)
downloadbrdo-91824358be16f8e5bfbdba6f14d9e588ef0cbc3b.tar.gz
brdo-91824358be16f8e5bfbdba6f14d9e588ef0cbc3b.tar.bz2
- Patch #216504 by webchick et al: added missing table alias in comment_render function.
-rw-r--r--modules/comment/comment.module4
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/comment/comment.module b/modules/comment/comment.module
index c72dd2b8e..0633d623d 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;
}