From 81767ac6d73d1f93cdea4733108355d7e01e7c26 Mon Sep 17 00:00:00 2001 From: Edsel Date: Thu, 20 Jul 2017 18:29:42 +0530 Subject: [PATCH] CRM-20648 Applied check exclusively to cancelled status ---------------------------------------- * CRM-20648: Allow registration in event with cancelled registration https://issues.civicrm.org/jira/browse/CRM-20648 --- CRM/Event/Form/Participant.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/CRM/Event/Form/Participant.php b/CRM/Event/Form/Participant.php index fe4862471e..7a0fcb1b45 100644 --- a/CRM/Event/Form/Participant.php +++ b/CRM/Event/Form/Participant.php @@ -858,12 +858,11 @@ 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)) . ")"; + $cancelledStatusID = CRM_Core_PseudoConstant::getKey('CRM_Event_BAO_Participant', 'status_id', 'Cancelled'); $dupeCheck = new CRM_Event_BAO_Participant(); $dupeCheck->contact_id = $contactId; $dupeCheck->event_id = $eventId; - $dupeCheck->whereAdd("{$statusClause}"); + $dupeCheck->whereAdd("status_id != {$cancelledStatusID} "); $dupeCheck->find(TRUE); if (!empty($dupeCheck->id)) { $errorMsg['event_id'] = ts("This contact has already been assigned to this event."); -- 2.25.1