I'm trying to import some users with this module, and would like their first and last names to create usernames. I am setting the 1 and 2 for the first and last name, however, when I import it the usernames are the beginning portions of the e-mails. I've tried this multiple times with different files. Any idea why this is going on?

Comments

compuguru’s picture

After doing some trouble shooting, I have figured out line 215 in user.module is the culprit:
user_module_invoke('insert', $array, $user, $category); The username is fine until that line in user.module is run. After that, something runs a query that changes the name field from 'JohnSmith' to 'john'. Is a module interfering with the import?

compuguru’s picture

I did more research and the update query is being run when it runs the email_registration module. Here's what it is doing:

query: SELECT uid FROM users WHERE uid != 79 AND LOWER(name) = LOWER('john')
error:

query: UPDATE users SET name = 'john' WHERE uid = '79'
error:

So essentially what it is doing is doing is changing the username from JohnSmith to john. Any idea why this is happening?

compuguru’s picture

Status: Active » Closed (fixed)

Wow, I'm stupid. I forgot I installed the Email Registration module, so it was changing the username. I disabled it and all works well now!