summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2009-02-13 02:25:59 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2009-02-13 02:25:59 +0000
commit9b50597eb243c0447eed6d9f41c9ad2e4de10b0d (patch)
tree08aea2b41249f374c0261c85b358da984aad3e8d /includes
parent535db9d024393d89a4843eea638056452b4c687d (diff)
downloadbrdo-9b50597eb243c0447eed6d9f41c9ad2e4de10b0d.tar.gz
brdo-9b50597eb243c0447eed6d9f41c9ad2e4de10b0d.tar.bz2
#369423 by nedjo: Fix drupal_write_record() bug with multi-field primary keys (with tests).
Diffstat (limited to 'includes')
-rw-r--r--includes/common.inc4
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;
}