Posted by coopers98 on February 3, 2009 at 5:34pm
Jump to:
| Project: | Drupal vB |
| Version: | 6.x-2.0 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Issue Summary
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
#1
Any update on this?
#2
Subscribe. This still exists.
#3
Did you test using the latest code?
#4
Sorry, 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.
#5
I 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.
#6
For 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;
#7
The 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...
#8
I 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);
#9