summaryrefslogtreecommitdiff
path: root/modules/node/node.module
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2006-12-21 22:22:14 +0000
committerDries Buytaert <dries@buytaert.net>2006-12-21 22:22:14 +0000
commit711b947854114cdb41b4f98b3437a8d4e18894c0 (patch)
tree607a34e01d9505d2a1d3ae71e11872cb2c90b77d /modules/node/node.module
parent983eda44acf810eb98ffdd247464abbec2b4d9d1 (diff)
downloadbrdo-711b947854114cdb41b4f98b3437a8d4e18894c0.tar.gz
brdo-711b947854114cdb41b4f98b3437a8d4e18894c0.tar.bz2
- Patch #104618 by robertDouglas and jvandyk: fixed node caching.
Diffstat (limited to 'modules/node/node.module')
-rw-r--r--modules/node/node.module10
1 files changed, 4 insertions, 6 deletions
diff --git a/modules/node/node.module b/modules/node/node.module
index 16d226f03..81f311db8 100644
--- a/modules/node/node.module
+++ b/modules/node/node.module
@@ -490,10 +490,9 @@ function node_load($param = array(), $revision = NULL, $reset = NULL) {
$nodes = array();
}
- $cachable = FALSE;
+ $cachable = ($revision == NULL);
$arguments = array();
if (is_numeric($param)) {
- $cachable = $revision == NULL;
if ($cachable && isset($nodes[$param])) {
return is_object($nodes[$param]) ? drupal_clone($nodes[$param]) : $nodes[$param];
}
@@ -533,10 +532,9 @@ function node_load($param = array(), $revision = NULL, $reset = NULL) {
$node->$key = $value;
}
}
- }
-
- if ($cachable) {
- $nodes[$param] = is_object($node) ? drupal_clone($node) : $node;
+ if ($cachable) {
+ $nodes[$node->nid] = is_object($node) ? drupal_clone($node) : $node;
+ }
}
return $node;