Index: /Applications/MAMP/htdocs/freetags/drupal/sites/all/modules/comment_alter_taxonomy/comment_alter_taxonomy.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/comment_alter_taxonomy/comment_alter_taxonomy.module,v
retrieving revision 1.5
diff -u -p -r1.5 comment_alter_taxonomy.module
--- comment_alter_taxonomy.module	27 Sep 2008 16:40:46 -0000	1.5
+++ comment_alter_taxonomy.module	27 Sep 2008 21:34:53 -0000
@@ -247,6 +247,19 @@ function comment_alter_taxonomy_comment(
         _comment_alter_taxonomy_save_tids($arg['nid'], 0);
       }
 
+      // Create rows in {comment_alter_taxonomy} for any comments on this node
+      // between the last comment saved to the table and this comment.  If there
+      // are any such comments, then store term data for those comments based
+      // on the data present in the last saved comment for this node in the table.
+      // This is necessary to prevent the module from thinking that terms were
+      // deleted by a comment between the last comment in the table and this comment.
+      // This code is really only necessary in the rare case when this module is disabled
+      // and one or more comments is made on a node, and then the module is re-enabled.
+      $result = db_query("SELECT cid FROM {comments} WHERE nid = %d AND cid > (SELECT MAX(cid) FROM {comment_alter_taxonomy} WHERE nid = %d) AND cid <> %d", $arg['nid'], $arg['nid'], $arg['cid']);
+      while ($row = db_fetch_object($result)) {
+        _comment_alter_taxonomy_save_tids($arg['nid'], $row->cid);
+      }
+
       if (isset($arg['taxonomy'])) {
         // Save the terms to the node itself.
         taxonomy_node_save($arg['nid'], $arg['taxonomy']);
@@ -663,9 +676,6 @@ function comment_alter_taxonomy_nodeapi(
       }
       break;
 
-    case 'update':
-      // TODO:  I might need to act here also.
-      break;
     case 'delete':
       db_query("DELETE FROM {comment_alter_taxonomy} WHERE nid = %d", $node->nid);
       break;
