From 63a862184b39fb680bb5423db63d8e1fcf0a7e17 Mon Sep 17 00:00:00 2001 From: Pradeep Nayak Date: Mon, 29 May 2017 14:18:19 +0530 Subject: [PATCH] CRM-20648, fixed validation to allow participant to register if their previous registration is cancelled ---------------------------------------- * CRM-20648: Allow registration in event with cancelled registration https://issues.civicrm.org/jira/browse/CRM-20648 --- CRM/Event/Form/Participant.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CRM/Event/Form/Participant.php b/CRM/Event/Form/Participant.php index c524956793..fe4862471e 100644 --- a/CRM/Event/Form/Participant.php +++ b/CRM/Event/Form/Participant.php @@ -858,9 +858,12 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment $eventId = CRM_Utils_Array::value('event_id', $values); if (!empty($contactId) && !empty($eventId)) { + $positiveStatus = CRM_Core_PseudoConstant::get('CRM_Event_BAO_Participant', 'status_id', array('condition' => ' is_counted = 1 ')); + $statusClause = "status_id IN (" . implode(',', array_keys($positiveStatus)) . ")"; $dupeCheck = new CRM_Event_BAO_Participant(); $dupeCheck->contact_id = $contactId; $dupeCheck->event_id = $eventId; + $dupeCheck->whereAdd("{$statusClause}"); $dupeCheck->find(TRUE); if (!empty($dupeCheck->id)) { $errorMsg['event_id'] = ts("This contact has already been assigned to this event."); -- 2.25.1