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

A logged in user can't register another participant if this participant has the same email as an existing user

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Major
    • Resolution: Fixed/Completed
    • Affects Version/s: 3.3.beta
    • Fix Version/s: 3.3.beta
    • Component/s: CiviEvent
    • Labels:
      None

      Description

      That's an edge case:

      I'm logged in as xavier, there is another drupal user john@doe.com (my colleague).

      I click on the registration link, "Welcome Xavier dutoit. (Not Xavier dutoit, or want to register a different person?)"

      I click I want register another person (/civicrm/event/register?&cid=0&reset=1&id=42),

      start filling the info for my colleague John, got an error message: "he email john@doe.com already exists in the database."

      The test is in CRM/Event/Form/Registration/Register.php
      require_once 'CRM/Core/BAO/UFMatch.php';
      if ( CRM_Core_BAO_UFMatch::isDuplicateUser( $email ) ) {
      $errors["email-{$self->_bltID}"] = ts( 'The email %1 already exists in the database.',
      array( 1 => $email ) );

      I fail to see the use case of this test (we already test the email duplicate or not, and the contact dupe...

      Anyway, I've added a patch that doesn't do that test only if the user is not registering someone else

        Attachments

        1. diff.patch
          0.9 kB
          xavier dutoit
        2. diff.patch
          1 kB
          xavier dutoit

          Activity

            People

            • Assignee:
              sushant Sushant Paste
              Reporter:
              xavier xavier dutoit
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: