From f8d3bf979817397c6b57bb7296e905b5e0d2be5e Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Sat, 22 Nov 2008 13:11:05 +0000 Subject: - Patch #330674 by catch: we can eliminate one database query because we have the parent node cached anyway. --- modules/node/node.module | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'modules') diff --git a/modules/node/node.module b/modules/node/node.module index b64dbdebf..1ac8a9d20 100644 --- a/modules/node/node.module +++ b/modules/node/node.module @@ -1446,11 +1446,8 @@ function theme_node_search_admin($form) { * Retrieve the comment mode for the given node ID (none, read, or read/write). */ function node_comment_mode($nid) { - static $comment_mode; - if (!isset($comment_mode[$nid])) { - $comment_mode[$nid] = db_result(db_query('SELECT comment FROM {node} WHERE nid = %d', $nid)); - } - return $comment_mode[$nid]; + $node = node_load($nid); + return $node->comment; } /** -- cgit v1.2.3