Index: modules/user.module =================================================================== --- modules/user.module (.../vendors/drupal/4.6.6) (revision 50558) +++ modules/user.module (.../components/drupal/4.6.6/src) (revision 50558) @@ -97,6 +97,7 @@ function user_save($account, $array = array(), $category = 'account') { // Dynamically compose a SQL query: $user_fields = user_fields(); + $user_int_fields = array('mode', 'sort', 'threshold', 'created', 'changed', 'status'); if ($account->uid) { user_module_invoke('update', $array, $account, $category); @@ -108,9 +109,15 @@ } else if (substr($key, 0, 4) !== 'auth') { if (in_array($key, $user_fields)) { - // Save standard fields - $query .= "$key = '%s', "; - $v[] = $value; + if (in_array($key, $user_int_fields) && empty($value)) { + $query .= "$key = '%s', "; + $v[] = "0"; + } + else { + // Save standard fields + $query .= "$key = '%s', "; + $v[] = $value; + } } else if ($key != 'roles') { // Roles is a special case: it used below. @@ -161,9 +168,11 @@ } else if (substr($key, 0, 4) !== 'auth') { if (in_array($key, $user_fields)) { - $fields[] = db_escape_string($key); - $values[] = $value; - $s[] = "'%s'"; + if(!empty($value)) { + $fields[] = db_escape_string($key); + $values[] = $value; + $s[] = "'%s'"; + } } } } Index: modules/node.module =================================================================== --- modules/node.module (.../vendors/drupal/4.6.6) (revision 50558) +++ modules/node.module (.../components/drupal/4.6.6/src) (revision 50558) @@ -422,9 +422,11 @@ // Prepare the query: foreach ($node as $key => $value) { if (in_array((string) $key, $fields)) { - $k[] = db_escape_string($key); - $v[] = $value; - $s[] = "'%s'"; + if(!empty($value)) { + $k[] = db_escape_string($key); + $v[] = $value; + $s[] = "'%s'"; + } } }