Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-3240

CRM_Profile_Form user email check should ignore anonymous users

    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 ) )

      { $fields['email'] = $user->mail; }

      </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.

        Attachments

          Activity

            People

            • Assignee:
              sunny.sharma Sunny Sharma
              Reporter:
              davidstrauss David Strauss
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: