common_debug('Updating, nickname ="'.$user->nickname.'" and email ="'.$user->email.'"');
common_debug('Original, nickname ="'.$original->nickname.'" and email ="'.$original->email.'"');
- if (FALSE === $user->update($original)) {
+ $result = $user->update($original);
+
+ if (!$result) {
common_server_error(_t('Couldnt update user.'));
return;
}
$profile->location = $location;
$profile->profileurl = common_profile_url($nickname);
- if (FALSE === $profile->update($orig_profile)) {
+ $result = $profile->update($orig_profile);
+
+ if (!$result) {
common_server_error(_t('Couldnt save profile.'));
return;
}
common_broadcast_profile($profile);
+
+ $user->query('COMMIT');
$this->show_form(_t('Settings saved.'), TRUE);
}
$oid->display = $display;
$oid->created = DB_DataObject_Cast::dateTime();
- common_debug('oid = '.print_r($oid, TRUE), __FILE__);
-
if (!$oid->insert()) {
$err = PEAR::getStaticProperty('DB_DataObject','lastError');
common_debug('DB error ' . $err->code . ': ' . $err->message, __FILE__);
return false;
}
-
- common_debug('oid = '.print_r($oid, TRUE), __FILE__);
+
+ # For some reason, autocommit is turned off
+
+ $oid->query('COMMIT');
return true;
}