function hook_node_presave


Error message

User warning: The following module is missing from the file system: theme/theme. For information about how to fix this, see the documentation page. in _drupal_trigger_error_with_delayed_logging() (line 1156 of /var/www/html/elmsln_community/
cis7 node.api.php hook_node_presave($node)
cle7 node.api.php hook_node_presave($node)
elmsmedia7 node.api.php hook_node_presave($node)
icor7 node.api.php hook_node_presave($node)
meedjum_blog7 node.api.php hook_node_presave($node)
mooc7 node.api.php hook_node_presave($node)

Act on a node being inserted or updated.

This hook is invoked from node_save() before the node is saved to the database.


$node: The node that is being inserted or updated.

Related topics

10 functions implement hook_node_presave()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

auto_nodetitle_node_presave in sites/all/modules/ulmus/auto_nodetitle/auto_nodetitle.module
Implements hook_node_presave().
book_node_presave in modules/book/book.module
Implements hook_node_presave().
entity_crud_hook_test_node_presave in modules/simpletest/tests/entity_crud_hook_test.module
Implements hook_node_presave().
feeds_node_presave in sites/all/modules/ulmus/feeds/feeds.module
Implements hook_node_presave().
forum_node_presave in modules/forum/forum.module
Implements hook_node_presave().

... See full list

4 invocations of hook_node_presave()
EntityAPIController::save in sites/all/modules/ulmus/entity/includes/
Implements EntityAPIControllerInterface.
field_attach_presave in modules/field/
Perform necessary operations just before fields data get saved.
node_save in modules/node/node.module
Saves changes to a node or adds a new node.
user_save in modules/user/user.module
Save changes to a user account or add a new user.


modules/node/node.api.php, line 684
Hooks provided by the Node module.


function hook_node_presave($node) {
  if ($node->nid && $node->moderate) {
    // Reset votes when node is updated:
    $node->score = 0;
    $node->users = '';
    $node->votes = 0;



Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/ in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/
The website encountered an unexpected error. Please try again later.