Respond to updates to a node.

Respond to updates to a node.

This is a node-type-specific hook, which is invoked only for the node type being affected. See @link node_api_hooks Node API hooks @endlink for more information.

Use hook_node_update() to respond to node update of all node types.

This hook is invoked from node_save() after the node is updated in the node table in the database, before field_attach_update() is called, and before hook_node_update() is invoked.


pivanov’s picture

hook_update gets invoked from within node_save(), which actually is wrapped in a transaction! Therefore the {node} table is not updated when hook_update is called. Don't query the table or, especially, don't call functions that rely on {node} table.

deltahex’s picture

yeah. it is mentioned in the hook_node_update documentation and is visible in the node_save() function code but still makes a lot of confusion especially if you are reading the comments... :) The transaction manual is giving some answers...

gollyg’s picture

Looking for the function documentation for applying a module update hook? Head over to hook_update_N