Allow second participant who has an existing email when same email checked
authorlarssandergreen <lars@wildsight.ca>
Fri, 7 Oct 2022 00:30:18 +0000 (18:30 -0600)
committerlarssandergreen <lars@wildsight.ca>
Fri, 7 Oct 2022 00:30:18 +0000 (18:30 -0600)
CRM/Event/Form/Registration/AdditionalParticipant.php

index 587332cf6559eb903f4eb551dbec90b32d626adf..fb9989b8809724e087ee413a0dd1d588165dc74b 100644 (file)
@@ -388,12 +388,9 @@ class CRM_Event_Form_Registration_AdditionalParticipant extends CRM_Event_Form_R
       CRM_Event_Form_Registration_Register::checkProfileComplete($fields, $errors, $self->_eventId);
 
       //Additional Participant can also register for an event only once
-      $isRegistered = CRM_Event_Form_Registration_Register::checkRegistration($fields, $self, TRUE);
-      if ($isRegistered) {
-        if ($self->_values['event']['allow_same_participant_emails']) {
-          $errors['_qf_default'] = ts('A person is already registered for this event.');
-        }
-        else {
+      if (!$self->_values['event']['allow_same_participant_emails']) {
+        $isRegistered = CRM_Event_Form_Registration_Register::checkRegistration($fields, $self, TRUE);
+        if ($isRegistered) {
           $errors["email-{$self->_bltID}"] = ts('A person with this email address is already registered for this event.');
         }
       }