Index: modules/node.module =================================================================== RCS file: /cvs/drupal/drupal/modules/node.module,v retrieving revision 1.526 diff -u -F^f -r1.526 node.module --- modules/node.module 30 Aug 2005 15:22:29 -0000 1.526 +++ modules/node.module 30 Aug 2005 15:48:57 -0000 @@ -1573,18 +1573,26 @@ function node_submit(&$node) { // Check whether the current user has the proper access rights to // perform this operation: if (node_access('update', $node)) { + // Give modules a chance to modify node before saving + node_invoke_nodeapi($node, 'update pre'); node_save(&$node); watchdog('content', t('%type: updated %title.', array('%type' => theme('placeholder', t($node->type)), '%title' => theme('placeholder', $node->title))), WATCHDOG_NOTICE, l(t('view'), 'node/'. $node->nid)); $msg = t('The %post was updated.', array ('%post' => node_get_name($node))); + // Give modules a chance to work after all insert/update hooks have completed + node_invoke_nodeapi($node, 'update post'); } } else { // Check whether the current user has the proper access rights to // perform this operation: if (node_access('create', $node)) { + // Give modules a chance to modify node before saving + node_invoke_nodeapi($node, 'insert pre'); node_save(&$node); watchdog('content', t('%type: added %title.', array('%type' => theme('placeholder', t($node->type)), '%title' => theme('placeholder', $node->title))), WATCHDOG_NOTICE, l(t('view'), "node/$node->nid")); $msg = t('Your %post was created.', array ('%post' => node_get_name($node))); + // Give modules a chance to work after all insert/update hooks have completed + node_invoke_nodeapi($node, 'insert post'); } }