Active
Project:
Drupal vB
Version:
6.x-2.0
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
3 Feb 2009 at 17:34 UTC
Updated:
20 Nov 2017 at 11:54 UTC
Jump to comment: Most recent
When attempting to edit an existing user who exists in both Drupal and vBullentin, and trying to modify user roles, upon submit, the resulting page will return the following errors:
* The name xxxx is already taken.
* The e-mail address xxx is already registered. Have you forgotten your password?
Upon disabling of the DrupalVB module I am able to make the proper edits. After re-enabling the module, I again receive the errors.
Comments
Comment #1
tcviper commentedAny update on this?
Comment #2
dalehgeist commentedSubscribe. This still exists.
Comment #3
sunDid you test using the latest code?
Comment #4
sunSorry, without further information this issue can only be marked as won't fix.
Feel free to re-open this issue if you want to provide further information. Thanks.
Comment #5
Exhar commentedI encountered the same issue. After some troubleshooting, I came to the conclusion that emptying drupal.drupalvb_users and exporting the users from drupal to VBulletin fixed this.
VBulletin 3.8.6, Drupal up to date.
Comment #6
jlporter commentedFor those that just want the error to go away simply comment out this line in drupalvb that calls drupalvb_user_validate which I think is inappropriately called on hook_user validate status.
diff --git a/modules/drupalvb/drupalvb.module b/modules/drupalvb/drupalvb.module
index 2c09546..d3d9eaf 100755
--- a/modules/drupalvb/drupalvb.module
+++ b/modules/drupalvb/drupalvb.module
@@ -311,7 +311,7 @@ function drupalvb_user($op, &$edit, &$account, $category = NULL) {
case 'validate':
if ($category == 'account' && (variable_get('drupalvb_acct_generation', TRUE) || variable_get('drupalvb_acct_sync', TRUE))) {
- return drupalvb_user_validate(arg(1), $edit);
+// return drupalvb_user_validate(arg(1), $edit);
}
break;
Comment #7
piersg commentedThe issue also occurred for me when the {drupal_vbusers} table became out of sync when I modifed a drupal user id. When a user is edited (password change by the user, username change by the admin, for example), the function "drupalvb_user_validate($uid, &$edit)" checks whether the username and/or email address is already in use in the vbulletin database with the following code flow:
Step 1: Find the corresponding vbulletin userid given the drupal user id (lookup in drupal_vbusers)
Step 2: If we are registering a new user, can change our own username or are an administrator, then check for a duplicate username. Look for a vb username the same as the new drupal username where the vb userid is not that found in step 1. If you get a match then flag an error
Step 3: repeat for email address
Correct working (ie databases in sync) example:
Drupal uid=3 username=piersg
Vbulletin userid=4 username=piersg
drupalvb_users uid=3 -> userid=4
Change password for drupal uid 3, is there a vb userid where name is piersg and userid is NOT 4? No, so all OK.
Incorrect working (ie databases not in sync) example:
Drupal uid=3 username=piersg
Vbulletin userid=4 username=piersg
drupalvb_users uid=3 -> userid=5
Change password for drupal uid 3, is there a vb userid where name is piersg and userid is NOT 5? Yes, because vb user piersg has userid=4, so fail
I have my drupal uids and vb userids the same (ie uid=23 -> userid=23) so don't usually have this problem...
Comment #8
ttkaminski commentedI found that if I have the 'me' Aliases module installed, then then arg(1) will be 'me' instead of the uid of the user account being updated. In function drupalvb_user(), case 'validate', you need to change:
return drupalvb_user_validate(arg(1), $edit);
to
return drupalvb_user_validate($account->uid, $edit);
Comment #9
ttkaminski commentedComment #10
bikrampal commentedIt appears that username is already in the database on another row. This can have many causes; importing users twice, creating accounts in a custom module without proper checking if the username is available, etc.
If you do not use the account edit forms, but modify users programmatically, it can appear that the same username is added to the database twice (the form validation does not run in those cases). Then later when you try to edit one such user, it cannot save because that account should not have existed in the first place. This measure is there so users cannot sign up with the same email twice, but since the user creation and edit form are in fact the same form (and as such have the same validation), it can happen during the save of a user as well.
Double check that you have no modules that can create accounts from username and check your database users table to identify the duplicate account.