Details
-
Type: Bug
-
Status: Done/Fixed
-
Priority: Major
-
Resolution: Fixed/Completed
-
Affects Version/s: 2.0
-
Fix Version/s: 2.1
-
Component/s: Core CiviCRM
-
Labels:None
Description
<code>
// hack add the email, does not work in registration, we need the real user object
// hack this will not work in joomla, not sure why we need it
global $user;
if ( isset( $user ) && ! CRM_Utils_Array::value( 'email', $fields ) )
</code>
$fields['email'] is generally not set because you tend to use email-Primary. In Drupal, $user is set for even anonymous users. So, this sets $fields['email'] = '' for anonymous users, which is bad.
One suggested change: also check that $user->uid > 0. That will exclude anonymous users.