- Changed '%s' into '%d' such that an empty $user->uid is converted to 0. Requi

red for Drupal to work on new versions of PostgreSQL.  Patch by James.
4.2.x
Dries Buytaert 2003-02-09 18:06:31 +00:00
parent e5aae050a7
commit 3d3a60740a
2 changed files with 2 additions and 2 deletions

View File

@ -473,7 +473,7 @@ function user_set_authmaps($account, $authmaps) {
if ($value) {
$result = db_query("SELECT COUNT(*) from authmap WHERE uid = '%d' && module = '%s'", $account->uid, $module["1"]);
if (db_result($result) == 0) {
$result = db_query("INSERT INTO authmap (authname, uid, module) VALUES ('%s', '%s', '%s')", $value, $account->uid, $module[1]);
$result = db_query("INSERT INTO authmap (authname, uid, module) VALUES ('%s', '%d', '%s')", $value, $account->uid, $module[1]);
}
else {
$result = db_query("UPDATE authmap SET authname = '%s' WHERE uid = '%d' AND module = '%s'", $value, $account->uid, $module["1"]);

View File

@ -473,7 +473,7 @@ function user_set_authmaps($account, $authmaps) {
if ($value) {
$result = db_query("SELECT COUNT(*) from authmap WHERE uid = '%d' && module = '%s'", $account->uid, $module["1"]);
if (db_result($result) == 0) {
$result = db_query("INSERT INTO authmap (authname, uid, module) VALUES ('%s', '%s', '%s')", $value, $account->uid, $module[1]);
$result = db_query("INSERT INTO authmap (authname, uid, module) VALUES ('%s', '%d', '%s')", $value, $account->uid, $module[1]);
}
else {
$result = db_query("UPDATE authmap SET authname = '%s' WHERE uid = '%d' AND module = '%s'", $value, $account->uid, $module["1"]);