From 7a6b2b25437f8578680b5c0089506e4167350834 Mon Sep 17 00:00:00 2001 From: Mathieu Lutfy Date: Thu, 25 Jul 2019 15:39:44 -0400 Subject: [PATCH] dev/event#6 Follow the 'same email' participants config setting for backend participants --- CRM/Event/Form/Participant.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CRM/Event/Form/Participant.php b/CRM/Event/Form/Participant.php index 02b6a75f2f..fca8bbf342 100644 --- a/CRM/Event/Form/Participant.php +++ b/CRM/Event/Form/Participant.php @@ -863,7 +863,12 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment } $eventId = CRM_Utils_Array::value('event_id', $values); - if (!empty($contactId) && !empty($eventId)) { + + $event = new CRM_Event_DAO_Event(); + $event->id = $eventId; + $event->find(TRUE); + + if (!$event->allow_same_participant_emails && !empty($contactId) && !empty($eventId)) { $cancelledStatusID = CRM_Core_PseudoConstant::getKey('CRM_Event_BAO_Participant', 'status_id', 'Cancelled'); $dupeCheck = new CRM_Event_BAO_Participant(); $dupeCheck->contact_id = $contactId; -- 2.25.1