? 193960-log-missing-field.patch
? 242945-blogapi-enable-freetagging-rev2.patch
? 242945-blogapi-enable-freetagging.patch
? 534092-cache-returns-expired-objects-rev4.patch
? modules/search/search.module-test
Index: includes/common.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/common.inc,v
retrieving revision 1.951
diff -u -p -r1.951 common.inc
--- includes/common.inc	31 Jul 2009 19:56:09 -0000	1.951
+++ includes/common.inc	3 Aug 2009 20:56:01 -0000
@@ -4450,14 +4450,15 @@ function drupal_schema_fields_sql($table
  * Save a record to the database based upon the schema.
  *
  * Default values are filled in for missing items, and 'serial' (auto increment)
- * types are filled in with IDs.
+ * types are filled in with IDs. Values for non-'serial' fields without default 
+ * values defined in the schema must be provided.
  *
  * @param $table
  *   The name of the table; this must exist in schema API.
  * @param $object
  *   The object to write. This is a reference, as defaults according to
  *   the schema may be filled in on the object, as well as ID on the serial
- *   type(s). Both array an object types may be passed.
+ *   type(s). Both array and object types may be passed.
  * @param $primary_keys
  *   If this is an update, specify the primary keys' field names. It is the
  *   caller's responsibility to know if a record for this object already
@@ -4500,8 +4501,12 @@ function drupal_write_record($table, &$o
     }
 
     // For inserts, populate defaults from schema if not already provided.
-    if (!isset($object->$field) && empty($primary_keys) && isset($info['default'])) {
-      $object->$field = $info['default'];
+    if (!isset($object->$field) && empty($primary_keys)) {
+      if (isset($info['default'])) {
+        $object->$field = $info['default'];
+      } else if ($info['type'] != 'serial') {
+        watchdog('php', 'drupal_write_record: value for %table.%field missing and no default value specified for field.', array('%table' => $table, '%field' => $field), WATCHDOG_ERROR);
+      }
     }
 
     // Track serial field so we can helpfully populate them after the query.
