Commit 711b9478 authored by Dries's avatar Dries

- Patch #104618 by robertDouglas and jvandyk: fixed node caching.

parent 983eda44
......@@ -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;
......
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