When profile.module is enabled, it won't hide username input field from registration form.
That's because profile module will change the array of form to $form[category_name]['name'] instead of just $form['name'].

Comments

sign’s picture

StatusFileSize
new863 bytes

actually it applies only in user_register form.

Christopher Herberte’s picture

Status: Needs review » Fixed

applied this patch http://drupal.org/node/183820
This seems like a sane way to fix the bug. module_exists() checks if the profile module is installed (of course, it's core) AND enabled which is that bit I was not sure on.

Thanks for the patch, sorry it took so long it'll be available in 5.x dev snapshot and next stable release.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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

scottrigby’s picture

#1 works for me. I know the issue is closed, but just another bit of positive feedback ;) thanks!

Christopher Herberte’s picture

Status: Closed (fixed) » Active

Thanks for the feedback Scott.

I am opening this issue back up because the same thing is happening with nodeprofile.module I just discovered.
I will apply the patch and commit it soon.

dorien’s picture

I have the profile module and the latest version (I checked it has the patch). But the username field keeps showing!

dorien’s picture

Version: 5.x-1.1 » 5.x-1.3

Let me clarify a bit:

It works fine on the login page. But the registration page keeps showing username whenever profile is enabled.

I am working on Drupal 5.7.

jayson’s picture

Hi, I also have this problem with nodeprofile.module, has anyone fixed this yet? Thanks!

faction’s picture

StatusFileSize
new1.04 KB

Rather than checking for a specific module, it seems to be much safer to just check for the existence of the $form['name'] and $form['account'] variables. Generalizing the code like this will ensure email_registration will work for profile, node profile, or any other module that alters the sign up form (including custom modules). This will also solve the problem of someone having node profile installed, but not configured to alter the sign up form.

  switch ($form_id) {
    case 'user_register':
      if ((!isset($form['name'])) && (isset($form['account']))) {

BTW - This my first code patch submission... so please be kind if I beefed it up. Thx.

Christopher Herberte’s picture

Status: Active » Reviewed & tested by the community
Christopher Herberte’s picture

faction, thanks. Your patch did not work but that's ok. 1 liner.
I'm committing this to HEAD please confirm that it's working.

sbandyopadhyay’s picture

Status: Reviewed & tested by the community » Fixed

Looks like this issue has been resolved a while ago.

Christopher Herberte’s picture

Status: Fixed » Closed (fixed)