[development] node not fully loaded in hook_update() in node admin form

Earnie Boyd earnie at users.sourceforge.net
Fri Mar 27 12:01:00 UTC 2009

Quoting "augustin (beginner)" <drupal.beginner at wechange.org>:

> Hello again,
> I have a different but related problem:
> If I update a node (e.g. published /not published) using the admin form at
> admin/content/node , hook_update() does not have the full node either, and
> notices are spewed out because none of my custom fields defined in
> hook_load() are set.
> Are hook_view() and hook_update() supposed to node_load() the nodes
> themselves?
> Looking back at some of my modules, I see some instances where I have done
> $node =  mynodetype_load($node) to get a full node.

You might need to change the weight of your module in the system table  
so that it executes later than the node and/or the taxonomy modules.   
Hooks are called in order of weight and within weight by the ascending  
sort order of the name of the module.  The default weight is zero.   
Otherwise you may have a module installed that is badly mistreating  
the node object.

   Make a Drupal difference and review core patches.

-- http://for-my-kids.com/  -- http://www.4offer.biz/

More information about the development mailing list