From a77601f669c0632b980d8a461eaf57963eff6c31 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Tue, 30 Dec 2008 20:15:43 +0000 Subject: - Patch #352337 by catch: avoid unnecessary query in comment render. --- modules/comment/comment.module | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'modules/comment/comment.module') diff --git a/modules/comment/comment.module b/modules/comment/comment.module index aa27ea651..831544c0e 100644 --- a/modules/comment/comment.module +++ b/modules/comment/comment.module @@ -1043,7 +1043,8 @@ function comment_render($node, $cid = 0) { $output .= theme('comment_view', $comment, $node, $links); } } - else { + // Only attempt to render comments if the node has been commented upon. + elseif ($node->comment_count) { //TODO Convert to dynamic queries once the pager query is updated to the new DBTNG API. -- cgit v1.2.3