compatible with USER_IMPORT ??
csilver - June 21, 2009 - 05:23
| Project: | Shared Email |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
| Issue tags: | duplicate email, sharedemail, user_import |
Jump to:
Description
I'm using the USER IMPORT module with this one. When a second person is imported with the same email address, the first uesr is modified instead of the second user imported.
Say I import "Jane Doe" with email "jdoe@gmail.com". She comes in fine. Then John Doe gets imported, also with "jdoe@gmail.com". jane is still in the system, but with John's other import data (roles, etc.).
Is this module supposed to be compatible with user import?
(also posted to the user import module)

#1
I would think this would be a feature request for the user_import module.
The sharedmail module just provides a way around form validation using the form API, whereas the user_import module probably uses the user API to add users. So sharedmail wouldn't get called at all during the import process. In fact you could probably disable the sharedmail module and still get the same results?
#2
Actually, if sharedmail is turned off, duplicate users don't come in at all, but there is no corruption of the data. So there is some attempt to use this module by user_import. I have posted the question to that module.
#3
Ah, my mistake. Prob one for this module then. Would have to follow the code through and find out why the bug's happening. Might get some time to do it later in the week.
#4
I've run a test import with the HEAD version of user_import, and I think this is one for user_import.
The 'validate' part of the sharedemail code didn't get called at all when I ran the test, so this module shouldn't have been having any impact on the import process, not sure why you got the changed behaviour when sharedemail is enabled.
My tests were run under drupal 6.12 with the latest sharedemail module, and no other contrib modules enabled.
The user_import module did fail on the import with a 'duplicate email' error, but I was able to avoid this by commenting out line 226 of supported/user.inc
function _user_import_validate_email($email = NULL, $duplicates_allowed = FALSE) {
if (empty($email)) {
user_import_errors(t('no email'));
}
elseif (!valid_email_address($email)) {
user_import_errors(t('invalid email'));
}
// Handle duplicate emails.
elseif (!$duplicates_allowed && _user_import_existing_uid($email)) {
// COMMENTED OUT TO ALLOW DUPE EMAILS user_import_errors(t('duplicate email'));
}
return;
}
It looks like there is a setting to allow duplicate emails, but I'm not sure how to set it.
#5
It seems the $duplicates_allowed flag is triggered by enabling Updates in the UI for user_import.