Posted by scor on December 19, 2006 at 8:21am
Jump to:
| Project: | Alternate login |
| Version: | 5.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
I use the profile module. When I update a user data from another tab of the edit user page, the alt login is reset.
I use this version of alt_login : v 1.1.2.2 2006/11/19 20:41:03
It's because the alt login is deleted on line 109. I added a condition on the else statement. Here is the new function I came up with to fix that:
function _alt_login_update($uid, &$edit) {
$alt_login = $edit['alt_login'];
// Only keep a database entry if an alternate login has been specified.
if ($alt_login != "") {
if (db_result(db_query('SELECT uid FROM {alt_login} WHERE uid = %d', $uid))) {
db_query("UPDATE {alt_login} SET alt_login = '%s' WHERE uid = %d", $alt_login, $uid);
}
else {
db_query("INSERT INTO {alt_login} (uid, alt_login) VALUES (%d, '%s')", $uid, $alt_login);
}
}
elseif (isset($alt_login) && $alt_login == "") {
db_query('DELETE FROM {alt_login} WHERE uid = %d', $uid);
}
// Don't want this saved in the data column of the users table, so unset.
unset($edit['alt_login']);
}
Comments
#1
there's a lot simpler way to do this :) see http://drupal.org/cvs?commit=48525 for details on the fix.
fixed in 4.7, 5, and HEAD. if there are still problems, please reopen the issue.
#2
#3
I have the same problem in 5.1 right now. Created personal information via Profile and when they update their personal information alternate login is deleted.
#4
also, are you using the latest release of the module?
if not, then please upgrade. if so, then please provide exact steps to duplicate the problem. i cannot fix it if i cannot see it :)
#5
i've made some more adjustments which should now completely prevent this issue from occuring. please download the latest release to resolve the issue. if the issue persists, please re-open this issue with a detailed steps on how to reproduce the issue.
please note that you should always perform tests with no other contributed modules enabled. if it's bug-free, then begin adding the other contribs back in. if the bug reappears, try to note which module is causing the conflict.
#6