summaryrefslogtreecommitdiff
path: root/modules/comment/comment.module
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2008-12-30 20:15:43 +0000
committerDries Buytaert <dries@buytaert.net>2008-12-30 20:15:43 +0000
commita77601f669c0632b980d8a461eaf57963eff6c31 (patch)
tree7d55f5e29cdfef982d0b6419647a111909f34d4f /modules/comment/comment.module
parent92a8adea653b29a9e6ee7778e8628f57b959ca4f (diff)
downloadbrdo-a77601f669c0632b980d8a461eaf57963eff6c31.tar.gz
brdo-a77601f669c0632b980d8a461eaf57963eff6c31.tar.bz2
- Patch #352337 by catch: avoid unnecessary query in comment render.
Diffstat (limited to 'modules/comment/comment.module')
-rw-r--r--modules/comment/comment.module3
1 files changed, 2 insertions, 1 deletions
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.