CMS MADE SIMPLE FORGE

Self Registration

 

[#3087] Error: No valid email address field found

avatar
Created By: GaryT (garyt)
Date Submitted: Fri Feb 27 06:59:34 -0500 2009

Assigned To: Robert Campbell (calguy1000)
Version: None
CMSMS Version: None
Severity: None
Resolution: Fixed
State: Closed
Summary:
Error: No valid email address field found
Detailed Description:
When Username is Email address and user selects:

"I have already completed the registration form, but did not receive an email,
can you please re-send it Click Here"

The option comes asking for "Username".

When you fill in the email address it returns:

"No valid email address field found".

This does not happen when an email address field is filled when Username is not
Email Address.

Is there a way around this or a fix?

Many Thanks.



History

Comments
avatar
Date: 2009-05-06 18:02
Posted By: Sander van den Berg (Rednes)

I have the same problem.

Been looking for the source of the problem and tracked it to:

// now find an email address property
    // and make sure it's of type 2
    $found = '';
    foreach( $relations as $reln )
      {
	foreach( $props as $prop )
	  {
		 
	    if( $prop['type'] == 6 && $reln['name'] == $prop['name'] )
	      {
		// found an email property
		foreach( $tempuserprops as $tempprop )
		  {
		    if( $reln['name'] == $tempprop['title'] )
		      {
			$found = $tempprop['data'];
			break;
		      }
		  }
	      }
	    if( $found != '' )
	      {
		break;
	      }
	  }
	if( $found != '' )
	  {
	    break;
	  }
      }
    if( !$found )
      {
	
	$parms['error'] = 1;
	$parms['message'] = $this->Lang('error_noemailaddress');
	$parms['mode'] = 'sendanotheremail';
	$this->myRedirect( $id, 'default', $returnid, $parms );
	return; 
      }
      
avatar
Date: 2009-05-06 18:05
Posted By: Sander van den Berg (Rednes)

In SelfRegistration.module.php around line 808

pls help!

got version: 1.2.3
      
avatar
Date: 2009-05-06 18:11
Posted By: Sander van den Berg (Rednes)

if( $prop['type'] == 6 

needs to be :

if( $prop['type'] == 2

In the code I posted above, because that's the original value.

I echo'ed some variables and discovered that prop['type'] isn't 2. And
$reln['name'] is not the same as $prop['name'].

Not sure what to do next though...
      
avatar
Date: 2009-06-13 17:40
Posted By: Pete Wright (Hekai)

Same problem here, except that it also happens when Username is NOT Email
address.

In case it helps, print_r says that all of the $props have type '0' as that
foreach loop starts, so the problem seems to stem from line 796:

$props = $feusers->GetPropertyDefns();

...and tracing back to the relevant db table, (prefix)_module_feusers_propdefn
confirms that the types are not being set. So this may be a bug in the current
FrontEndUsers module, rather than SelfRegistration?
      
avatar
Date: 2009-06-13 17:53
Posted By: Pete Wright (Hekai)

...or were possibly un-set. After checking the DB, the FEU module was listing
all the fields as 'text'. Reset the email field to 'email', and the problem goes
away (as the prop type has, indeed, become '2').

This may be related to the fact that I had originally set username to email,
then decided against it. If username=email _is_ wanted, then maybe make sure
username is set as an 'email' type field in FEU?
      
avatar
Date: 2009-06-16 07:58
Posted By: Sander van den Berg (Rednes)

Right before:

if ( !$found )
      {
	
	$parms['error'] = 1;
	$parms['message'] = $this->Lang('error_noemailaddress');
	$parms['mode'] = 'sendanotheremail';
	$this->myRedirect( $id, 'default', $returnid, $parms );
	return; 
      }



I put:  $found = $username;

And now it works...hope I didn't wreck anything else though...
      
avatar
Date: 2009-09-06 13:26
Posted By: Robert Campbell (calguy1000)

fixed in svn.
      
avatar
Date: 2010-03-04 20:04
Posted By: Ilya  (ilia3d)

thanks Pete, DB fix works just fine for me!
      
Updates

Updated: 2011-12-23 10:29
cmsms_version_id: => -1
state: Open => Closed

Updated: 2009-09-06 13:26
resolution_id: => 7