--- taxonomy.old	2005-09-28 11:26:20.000000000 -0700
+++ taxonomy.module	2005-09-28 11:53:02.000000000 -0700
@@ -377,7 +377,7 @@ function taxonomy_overview() {
 /**
  * Generate a form element for selecting terms from a vocabulary.
  */
-function taxonomy_form($vid, $value = 0, $help = NULL, $name = 'taxonomy') {
+function taxonomy_form($vid, $value = 0, $help = NULL, $name = 'taxonomy', $op = 'create') {
   $vocabulary = taxonomy_get_vocabulary($vid);
   $help = ($help) ? $help : $vocabulary->help;
   if ($vocabulary->required) {
@@ -387,7 +387,7 @@ function taxonomy_form($vid, $value = 0,
     $blank = '<'. t('none') .'>';
   }
 
-  return _taxonomy_term_select(check_plain($vocabulary->name), $name, $value, $vid, $help, intval($vocabulary->multiple), $blank, array(), 'create');
+  return _taxonomy_term_select(check_plain($vocabulary->name), $name, $value, $vid, $help, intval($vocabulary->multiple), $blank, array(), $op);
 }
 
 /**
@@ -439,10 +439,13 @@ function taxonomy_get_vocabularies($type
  * Generate a form for selecting terms to associate with a node.
  */
 function taxonomy_node_form($type, $node = '', $help = NULL, $name = 'taxonomy') {
+  $op = 'create';
   if (!$node->taxonomy) {
     if ($node->nid) {
       if (function_exists('taxonomy_access')) {
-        $terms = array_keys(taxonomy_node_get_terms($node->nid, 'tid', 'create'));
+      	// if nid exists, we are updating the node
+        $op = 'update';
+        $terms = array_keys(taxonomy_node_get_terms($node->nid, 'tid', $op));
       }
       else {
         $terms = array_keys(taxonomy_node_get_terms($node->nid));
@@ -458,7 +461,7 @@ function taxonomy_node_form($type, $node
 
   $c = db_query("SELECT v.*, n.type FROM {vocabulary} v INNER JOIN {vocabulary_node_types} n ON v.vid = n.vid WHERE n.type = '%s' ORDER BY v.weight, v.name", $type);
   while ($vocabulary = db_fetch_object($c)) {
-    $result[] = taxonomy_form($vocabulary->vid, $terms, $help, $name);
+    $result[] = taxonomy_form($vocabulary->vid, $terms, $help, $name, $op);
   }
   return $result ? $result : array();
 }
@@ -508,7 +511,7 @@ function taxonomy_node_get_terms($nid, $
 /**
  * Save term associations for a given node.
  */
-function taxonomy_node_save($nid, $terms) {
+function taxonomy_node_save($nid, $terms, $op = 'create') {
   taxonomy_node_delete($nid);
 
   if (is_array($terms)) {
@@ -522,7 +525,7 @@ function taxonomy_node_save($nid, $terms
       }
       else if ($term) {
         if (function_exists('taxonomy_access')) {
-	  if (taxonomy_access('create', $term)) {
+	  if (taxonomy_access($op, $term)) {
             db_query('INSERT INTO {term_node} (nid, tid) VALUES (%d, %d)', $nid, $term);
 	  }
 	}
@@ -982,10 +985,10 @@ function taxonomy_render_nodes($result) 
 function taxonomy_nodeapi($node, $op, $arg = 0) {
   switch ($op) {
     case 'insert':
-      taxonomy_node_save($node->nid, $node->taxonomy);
+      taxonomy_node_save($node->nid, $node->taxonomy, 'create');
       break;
     case 'update':
-      taxonomy_node_save($node->nid, $node->taxonomy);
+      taxonomy_node_save($node->nid, $node->taxonomy, 'update');
       break;
     case 'delete':
       taxonomy_node_delete($node->nid);
