summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2009-12-06 17:01:52 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2009-12-06 17:01:52 +0000
commit06c5979961971394c0451f07f5280b30906677c8 (patch)
tree15b7ca6217fe562773b4d2bd793ff410de54a646 /includes
parentb12a25d24f68d7bfb44240cd84dcfc54c17e3009 (diff)
downloadbrdo-06c5979961971394c0451f07f5280b30906677c8.tar.gz
brdo-06c5979961971394c0451f07f5280b30906677c8.tar.bz2
#626790 by justinrandell: Fixed bug where drupal_write_record() returns FALSE for valid update queries.
Diffstat (limited to 'includes')
-rw-r--r--includes/common.inc6
1 files changed, 4 insertions, 2 deletions
diff --git a/includes/common.inc b/includes/common.inc
index 679c3cbd0..050e8e77f 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -5875,8 +5875,10 @@ function drupal_write_record($table, &$object, $primary_keys = array()) {
}
}
// If we have a single-field primary key but got no insert ID, the
- // query failed.
- elseif (count($primary_keys) == 1) {
+ // query failed. Note that we explicitly check for FALSE, because
+ // a valid update query which doesn't change any values will return
+ // zero (0) affected rows.
+ elseif ($last_insert_id === FALSE && count($primary_keys) == 1) {
$return = FALSE;
}