Index: comment_cck.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/comment_cck/comment_cck.module,v
retrieving revision 1.1
diff -u -r1.1 comment_cck.module
--- comment_cck.module	8 Sep 2007 17:54:45 -0000	1.1
+++ comment_cck.module	1 Jun 2008 20:09:40 -0000
@@ -51,29 +51,36 @@
       // it's much easier to remove fields, second it prevents duplicates
       variable_set('comment_cck_fields_'. $form_values['type_name'], array_merge(array($form_values['field_name'] => $form_values['field_name']), variable_get('comment_cck_fields_'. $form_values['type_name'], array())));
     }
-    return;
+    else {
+      variable_del('comment_cck_node_'. $form_values['type_name']);
+    }
   }
 }
 
-function comment_cck_comment($comment, $op) {
+function comment_cck_comment(&$comment, $op) {
   switch ($op) {
     case 'insert':
-      // Merge the new array with the old node
-      $node = (object) array_merge((array) node_load($comment['nid']), $comment['comment_cck']);
-      $previous_vid = $node->vid;
-      // We want a new revision
-      $node->revision = 1;
-      // Required to get the data in the right format
-      content_submit($node);
-      // Save the node
-      node_save($node);
-      // Record that this comment added a revision
-      db_query('INSERT INTO {comment_cck_revisions} (cid, vid, nid, previous_vid) VALUES (%d, %d, %d, %d)', $comment['cid'], $node->vid, $node->nid, $previous_vid);
+    case 'update':
+      $node = node_load($comment->nid);
+      if (variable_get('comment_cck_node_'. $node->type, FALSE) == TRUE) {
+        // Merge the new array with the old node
+        $node = (object) array_merge((array) node_load($comment['nid']), $comment['comment_cck']);
+        $previous_vid = $node->vid;
+        // We want a new revision
+        $node->revision = 1;
+        // Required to get the data in the right format
+        content_submit($node);
+        // Save the node
+        node_save($node);
+        // Record that this comment added a revision
+        db_query('INSERT INTO {comment_cck_revisions} (cid, vid, nid, previous_vid) VALUES (%d, %d, %d, %d)', $comment['cid'], $node->vid, $node->nid, $previous_vid);
+      }
       break;
     case 'view':
       $node = node_load($comment->nid);
       if (variable_get('comment_cck_node_'. $node->type, FALSE) == TRUE) {
         $fields = variable_get('comment_cck_fields_'. $node->type, array());
+
         $previous_text = $comment->comment;
         $comment_revision = db_fetch_object(db_query('SELECT * FROM {comment_cck_revisions} WHERE cid = %d', $comment->cid));
         $current_node = _comment_cck_build_node((int) $comment_revision->nid, $comment_revision->vid);
@@ -95,7 +102,8 @@
           }
         }
         if (!empty($result)) {
-          $comment->comment = theme('table', array(), $result) . $previous_text;
+          drupal_add_css(drupal_get_path('module', 'comment_cck') .'/comment_cck.css');
+          $comment->comment = theme('table', array(), $result, array('class' => 'comment_cck')) . $previous_text;
         }
       }
       break;
