Index: content.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/cck/content.module,v
retrieving revision 1.230
diff -u -r1.230 content.module
--- content.module	6 Jan 2008 03:12:31 -0000	1.230
+++ content.module	8 Jan 2008 22:40:16 -0000
@@ -898,8 +898,21 @@
       }
       return $additions;
 
-    case 'update':
     case 'insert':
+      // Manual node_save calls might not have all fields filled in.
+      // We need to make sure all tables get at least an empty record,
+      // or subsequent edits, using drupal_write_record() in update mode,
+      // won't insert any data.
+      foreach ($type['fields'] as $field) {
+        if (!isset($node->$field['field_name'])) {
+          foreach (array_keys($field['columns']) as $column) {
+            $node->{$field['field_name']}[0][$column] = NULL;
+          }
+        }
+      }
+      // Fall through to the 'update' case.
+
+    case 'update':
       foreach ($type['tables'] as $table) {
         $schema = drupal_get_schema($table);
         $record = array();
