Index: modules/node.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/node.module,v
retrieving revision 1.519
diff -u -F^f -r1.519 node.module
--- modules/node.module	11 Aug 2005 12:53:39 -0000	1.519
+++ modules/node.module	19 Aug 2005 18:38:38 -0000
@@ -1541,18 +1541,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->nid = 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_invoke($node, 'node_name')));
+      // 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->nid = 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_invoke($node, 'node_name')));
+      // Give modules a chance to work after all insert/update hooks have completed
+      node_invoke_nodeapi($node, 'insert post');
     }
   }
 
