Not working with profile module

sign - October 16, 2007 - 08:47
Project:Email Registration
Version:5.x-1.3
Component:Code
Category:bug report
Priority:normal
Assigned:sign
Status:closed
Description

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'].

AttachmentSize
email_registration_profile_fix.patch1.43 KB

#1

sign - October 17, 2007 - 10:09

actually it applies only in user_register form.

AttachmentSize
email_registration_profile_fix_1.patch 863 bytes

#2

Chris Herberte - February 17, 2008 - 00:41
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.

#3

Anonymous (not verified) - March 2, 2008 - 00:42
Status:fixed» closed

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

#4

scottrigby - March 6, 2008 - 01:29

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

#5

Chris Herberte - March 6, 2008 - 01:39
Status:closed» 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.

#6

dorien - April 30, 2008 - 12:36

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

#7

dorien - May 7, 2008 - 08:33
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.

#8

jayson - July 28, 2008 - 01:19

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

#9

faction - September 22, 2008 - 16:17

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.

<?php
 
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.

AttachmentSize
email_registration_nodeprofile_fix.patch 1.04 KB

#10

Chris Herberte - October 2, 2008 - 07:50
Status:active» reviewed & tested by the community

#11

Chris Herberte - October 2, 2008 - 08:31

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.

#12

sbandyopadhyay - January 30, 2009 - 03:27
Status:reviewed & tested by the community» fixed

Looks like this issue has been resolved a while ago.

#13

Chris Herberte - February 11, 2009 - 23:11
Status:fixed» closed
 
 

Drupal is a registered trademark of Dries Buytaert.