Modules may want to inject fields into the account fieldset on account registration forms. Unfortunately, user_register() uses array_merge() rather than array_merge_recursive() when combining core fields with those provided by modules. Consequently, any fields the user module places in $form['account'] is clobbered by anything modules return. Patch is attached.

--
Sammy Spets
Synerger
http://synerger.com

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mcarrera’s picture

My users get kicked out when they go to /forums/forum_alias. Nothing happens if they access by forum/tid (eg forum/1)
Just wonder if the problem is related with the one described in this issue

Thanks!

moshe weitzman’s picture

looks like a bug. can't test the fix right now. would be nice if someone provided a small module which showed off the fix.

Alice Heaton’s picture

Version: 6.1 » 7.x-dev
Status: Needs review » Reviewed & tested by the community

Patch is still valid for Drupal 7, so moving it there so that it gets more attention ; please commiters make sure it gets back-ported to D6 :)

Reviewer notes :

  1. Code is up to standards ; does what it says on the issue ; no side effects to speak of (see point 3) ;
  2. If it was by design that modules shouldn't insert fields in the account registration form, then this patch shouldn't be applied - though I don't see why this would be the case
  3. If there was any module that actually replaced the whole of the account registration form, then this patch would break backwards compatibility with such a module. I guess likely-hood of that happening is low.
Anonymous’s picture

Status: Reviewed & tested by the community » Needs work

The last submitted patch failed testing.

casey’s picture

Version: 7.x-dev » 6.x-dev
teliseo’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, user.module.rego_.op_.fix_.200802280948.patch, failed testing.

teliseo’s picture

Status: Needs work » Reviewed & tested by the community
FileSize
348 bytes

Here’s a replacement patch against current 6.x-dev with a proper path that should pass testing. Since this bug is not relevant to D7, and has few side effects, I’m hoping this patch can now be applied to 6.x-dev.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, user.module-register_op_merge.patch, failed testing.

teliseo’s picture

Status: Needs work » Reviewed & tested by the community
FileSize
380 bytes

Another try at a patch...

Status: Reviewed & tested by the community » Needs work

The last submitted patch, user.module-register_op_merge.patch, failed testing.

ColinMctavish’s picture

subscribing

teliseo’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, user.module-register_op_merge.patch, failed testing.

Status: Needs work » Closed (outdated)

Automatically closed because Drupal 6 is no longer supported. If the issue verifiably applies to later versions, please reopen with details and update the version.