Howdy,
I can import users and their associated content just fine, however Welcome Emails are not being sent out. I am getting the following errors after importing them:
warning: Invalid argument supplied for foreach() in
/sites/all/modules/user_import/user_import.module on line 1045.
warning: Variable passed to each() is not an array or object in
/sites/all/modules/user_import/supported/user_import.inc on line 55.
which is this line in user_import.module
foreach ($type_options as $field_id => $label) {
and in user_import.inc
'!edit_uri' => url('user/'. $account->uid .'/edit', NULL, NULL, TRUE),
I have set the username to be the email address. I have tried to set it to their First Name, Last Name, but neither change seems to be making any difference. Welcome Emails are still not being sent out.
Any help or pointers would be greatly appreciated.
A couple of ideas:
1. At the moment there seems to be a little problem if you have multiple nodeprofiles. If you import a user with nodeprofile data it creates a node for each nodeprofile, even though only one should be created. There is no option at the moment to select which nodeprofile it should create.
2. There also seems to be no option to sign people who are imported to be signed up to simplenews.
Best,
Christian
Comments
Comment #1
cnolle commentedI should add that this error occurs whenever I pick a CSV file to import (even sample.txt) and click next:
warning: Invalid argument supplied for foreach() in /sites/all/modules/user_import/user_import.module on line 1045
Comment #2
cnolle commentedIt turns out that this has something to do with the use of the SMTP module, user import seems to ignore its settings.
Comment #3
cnolle commentedUpdate:
The issue lies with user_import.inc. By default using the mail function directly and drupal_mail:
(Around line 92)
Was:
mail($account->mail, $subject, $body, $header);
Change to:
$to = $account->mail;
$from = $user->mail;
drupal_mail($account->mail,$to, $subject, $body, $from);
Its working but its not sending out the auto generated password.
Comment #4
cnolle commentedAnother update:
Just a quick note. Do NOT upgrade to the latest version of node import (1.8 as of writing) as it won't work with user import and nodeprofiles. Rather use 1.6 as that version works just fine. I am not sure what the difference is between the two versions.
C
Comment #5
ambereyes commentedTwo causes:
Katrina
--
www.ambereyes.net
Comment #6
ambereyes commentedBTW, your comment (ideas) about problems with node profiles is a separate bug, and in a strange way is kind of related to one of my issues #323118: Missing location fields within node profiles during user import but it should probably be treated as a separate bug in this queue. If I get time, I will dig up my research on it. But please go ahead and create an issue for it.
Katrina
--
www.ambereyes.net
Comment #7
ambereyes commentedI fixed the #2 cause (in comment #5) by setting the password variable prior to the module invoke call in the _user_import_process function in user_import.module at about line 1420.
Katrina
--
www.ambereyes.net
Comment #8
cnolle commentedHowdy,
Thanks for your fix above. I am not using it for now, instead I am sending out the one-time login URL, which in some ways (or at least for my purpose) is better as it forces the newly registered user to set their own password immediately. I have opened an issue regarding the ability to select your Node profile content on import.
Best,
Christian
Comment #9
robert castelo commentedFixed in 5.x-2.0-beta1.