The email reg module sets username to the first part of a person's email [ don't know of any settings for that mod to change that either].

Nonetheless, your module doesn't set the username....the username stays the same as the first part of their email prior to @.

Anyway to fix this? Can we change the weight of this module to fire after that one or something?

Comments

sgerbino’s picture

The problem is that Drupal will REQUIRE a username in order to register, Realname registration is "hacky" in the fact that it hides the username field and gives it the value "unset_username". Then in hook_user_presave(), it checks to see if the username is "unset_username" to generate the username based off the name fields. If Email registration is changing that value, Realname registration will think it has already changed the username.

In realname_registration.module line 91, change this:

    if ($edit['name'] == 'unset_username') {

to:

    if (TRUE) {

I believe the username will be generated each time it is saved (if you make this change). Which is not ideal. Anyhow, that's just a possible quick workaround, clearly a better solution is needed.

IWasBornToWin’s picture

Status: Active » Fixed

Your quick reply is very appreciated. I changed the code. On the first time registration [prior to new member receiving log in email] it didn't change username. But after the user logged in and added their own password and saved...it did.

Another cool thing--if user ever changes their first, middle, or last name, it will also update the username to match. Maybe it already does that?

Question--once this module is installed, regardless of any other settings, the admin is now stating they want the username to be a real name so I wonder why it would ever be necessary to run a condition of looking for unset_username? If any condition needed to be run it would seem the code should look to see if the username is "field_first_name""filed_last_name" or whatever options the admin has selected.

Very cool module....thanks

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.