diff options
Diffstat (limited to 'includes/common.inc')
-rw-r--r-- | includes/common.inc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/includes/common.inc b/includes/common.inc index 9c4bb5492..c1dc6f8f2 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -3967,7 +3967,9 @@ function drupal_write_record($table, &$object, $primary_keys = array()) { $object->$serial = $last_insert_id; } } - else { + // If we have a single-field primary key but got no insert ID, the + // query failed. + elseif (count($primary_keys) == 1) { $return = FALSE; } |