Index: taxonomy_menu.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/taxonomy_menu/taxonomy_menu.module,v
retrieving revision 1.19.2.2.2.47
diff -u -r1.19.2.2.2.47 taxonomy_menu.module
--- taxonomy_menu.module	24 Nov 2009 02:50:52 -0000	1.19.2.2.2.47
+++ taxonomy_menu.module	24 Nov 2009 14:53:42 -0000
@@ -329,12 +329,15 @@
  */
 function taxonomy_menu_nodeapi(&$node, $op, $a3, $a4) {
   static $terms_old;
-  static $status; // 2 == TRUE, 1 == FALSE
+  static $status = array(); // 2 == TRUE, 1 == FALSE
 
+  // Always run code for new nodes so remove any previously set values for new nodes.
+  unset($status[0]);
+  // Only run under certian situations.
   if (($op == 'presave' || $op == 'update' || $op == 'insert' || $op == 'delete') & $node->taxonomy) {
     // Remove the 'key' key value that is put in there by content taxonomy
     unset($node->taxonomy['key']);
-    if (!$status) {
+    if (!$status[$node->nid]) {
       // The delete operation formats the taxonomy array differently
       // so pull the array keys instead of values which is always the tid
       $node_tids = array_keys($node->taxonomy);
@@ -344,15 +347,15 @@
       foreach ($vids as $vid) {
         if (variable_get('taxonomy_menu_display_num_'. $vid, FALSE)
           || variable_get('taxonomy_menu_hide_empty_terms_'. $vid, FALSE)) {
-            $status = 2;
+            $status[$node->nid] = 2;
         }
         else {
-          $status = 1;
+          $status[$node->nid] = 1;
         }
       }
     }
 
-    if ($status == 2) {
+    if ($status[$node->nid] == 2) {
       switch ($op) {
         case 'insert':
         case 'update':
@@ -363,7 +366,7 @@
 
           //merge current terms and previous terms to update both menu items.
           $terms = array_unique(array_merge((array)$terms_new, (array)$terms_old));
-          _taxonomy_menu_nodeadpi_helper($op, $terms);
+          _taxonomy_menu_nodeapi_helper($op, $terms);
           break;
 
         case 'presave':
@@ -377,7 +380,7 @@
           //since the delete operation is run after the data is deleted
           //pull the terms from the node object
           $terms = array_keys($node->taxonomy);
-          _taxonomy_menu_nodeadpi_helper($op, $terms);
+          _taxonomy_menu_nodeapi_helper($op, $terms);
           break;
       }
     }
@@ -389,7 +392,7 @@
  * @param $tids
  * @return unknown_type
  */
-function _taxonomy_menu_nodeadpi_helper($op, $terms = array()) {
+function _taxonomy_menu_nodeapi_helper($op, $terms = array()) {
   foreach ($terms as $key => $tid) {
     $term = taxonomy_get_term($tid);
     //update the menu for each term if necessary
