I was trying to set $account['name'] using hook_user_import_pre_save when creating users, but it was getting overwritten by this line:

$account['name'] = _user_import_create_username($username_order, $username_data, $username_abbreviate, $settings['username_space']);

Would you be able to add an if statement to only run _user_import_create_username() if $account['name'] is empty.

I've attached a patch file with the idea I had to allow for this. I'm having a tough time, non-hacking way of programmatically adding the username to the imported file before the email goes out. I thought I could use user_import_after_save to just change the username, but the email that was going out was showing the random pass.

In my current application, we generate the username based on a profile field, and it is automated.

Thanks!

Aaron

CommentFileSizeAuthor
user_import.module.diff1.07 KBaklump