Commit 5278747d authored by drumm's avatar drumm

#86842 by pwolanin. Don't attempt to clone non-object nodes.

parent 30d7bd56
......@@ -479,11 +479,12 @@ function node_load($param = array(), $revision = NULL, $reset = NULL) {
$nodes = array();
}
$cachable = FALSE;
$arguments = array();
if (is_numeric($param)) {
$cachable = $revision == NULL;
if ($cachable && isset($nodes[$param])) {
return drupal_clone($nodes[$param]);
return is_object($nodes[$param]) ? drupal_clone($nodes[$param]) : $nodes[$param];
}
$cond = 'n.nid = %d';
$arguments[] = $param;
......@@ -524,7 +525,7 @@ function node_load($param = array(), $revision = NULL, $reset = NULL) {
}
if ($cachable) {
$nodes[$param] = drupal_clone($node);
$nodes[$param] = 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