--- editablefields.module	2010-01-18 11:48:10.000000000 +0300
+++ editablefields.module.patch	2010-05-07 17:30:18.919445305 +0300
@@ -270,7 +270,7 @@ function editablefields_submit() {
   $nid = $_POST['nid'];
   $field_name = $_POST['field'];
   $delta = $_POST['delta'];
-
+  
   $node = node_load($nid);
 
   if (node_access('update', $node)) {
@@ -295,7 +295,7 @@ function editablefields_submit() {
           $form_state['values'][$field_name][0]=array('value'=>0);
         }
       }
-
+      
       drupal_execute('editablefields_form', $form_state, $node, $field_name, $delta);
       
       $err = drupal_get_messages();
@@ -315,13 +315,43 @@ function editablefields_submit() {
       if (content_handle('widget', 'multiple values', $field) == CONTENT_HANDLE_CORE) {
         if ($node->{$field_name}[$delta] != $form_state['values'][$field_name][0]) {
           $node->{$field_name}[$delta] = $form_state['values'][$field_name][0];
+          // On load, nodecomment stores $node->comment in $node->node_comment
+          // and sets $node->comment to COMMENT_NODE_DISABLED.
+          // On node_save($node) the last value is written to the database
+          // so we have to do the reverse before and restore after save.
+          // But only when the nodecomment module is installed and enabled.
+          if (module_exists('nodecomment')) {
+            $node_comment = $node->comment;
+            $node_node_comment = $node->node_comment;
+            $node->comment = $node_node_comment;
+            $node->node_comment = $node_comment;
+          }
           node_save($node);
+          if (module_exists('nodecomment')) {
+            $node->node_comment = $node_node_comment;
+            $node->comment = $node_comment;
+          }
         }
       }
       else {
         if ($node->{$field_name} != $form_state['values'][$field_name]) {
           $node->{$field_name} = $form_state['values'][$field_name];
+          // On load, nodecomment stores $node->comment in $node->node_comment
+          // and sets $node->comment to COMMENT_NODE_DISABLED.
+          // On node_save($node) the last value is written to the database
+          // so we have to do the reverse before and restore after save.
+          // But only when the nodecomment module is installed and enabled.
+          if (module_exists('nodecomment')) { // 
+            $node_comment = $node->comment;
+            $node_node_comment = $node->node_comment;
+            $node->comment = $node_node_comment;
+            $node->node_comment = $node_comment;
+          }
           node_save($node);
+          if (module_exists('nodecomment')) {
+            $node->node_comment = $node_node_comment;
+            $node->comment = $node_comment;
+          }
         }
       }
       // make sure sensible headers etc are sent...
