Commit f8d3bf97 authored by Dries's avatar Dries

- Patch #330674 by catch: we can eliminate one database query because we have...

- Patch #330674 by catch: we can eliminate one database query because we have the parent node cached anyway.
parent ea28f6b7
......@@ -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;
}
/**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment