[drupal-docs] [bug] Nodeapi load operation drupaldocs

Fool2 drupal-docs at drupal.org
Wed Oct 12 18:01:42 UTC 2005


Issue status update for 
http://drupal.org/node/33876
Post a follow up: 
http://drupal.org/project/comments/add/33876

 Project:      Documentation
 Version:      <none>
 Component:    Developer Guide
 Category:     bug reports
 Priority:     normal
 Assigned to:  Anonymous
 Reported by:  Fool2
 Updated by:   Fool2
 Status:       active

Under nodeapi in drupaldocs, the return value for the load operation is
listed as "The "load" operation should return an object containing
extra fields to be merged into the node object. "


http://drupaldocs.org/api/4.6/function/hook_nodeapi


However, when I return a value like so from a module:
case "load":
$obj = new stdclass;
$obj->foo = "bar";
return $obj;
break;


$node->foo is not defined when the node is loaded. Now, this means the
doc either has to be more specific about how the object is merged, or
is simply wrong.


The implementations I have seen (and the ones I have gotten to work
myself) all are coded like so:


case "load":
$node->foo="bar";
break;


Anybody have any input on this confusion?




Fool2




More information about the drupal-docs mailing list