From aae2f9e680b20292659a3fbef2308ee086229b6e Mon Sep 17 00:00:00 2001 From: Jamie McClelland Date: Tue, 14 Oct 2014 10:53:01 -0400 Subject: [PATCH] CRM-15452 - ensure dupes not added when no event fee is used. ---------------------------------------- * CRM-15452: When no registration fee is involved, duplicate registration still created for event https://issues.civicrm.org/jira/browse/CRM-15452 --- CRM/Event/Form/Participant.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/CRM/Event/Form/Participant.php b/CRM/Event/Form/Participant.php index 3bb12477b1..69ba3d9655 100644 --- a/CRM/Event/Form/Participant.php +++ b/CRM/Event/Form/Participant.php @@ -953,13 +953,17 @@ class CRM_Event_Form_Participant extends CRM_Contact_Form_Task { // (See above in formRule()). When adding more than one contact, the duplicates are // removed automatically and the user receives one notification. if ($this->_action & CRM_Core_Action::ADD) { - if(!$this->_single && !empty($this->_eventId)) { + $event_id = $this->_eventId; + if(empty($event_id) && !empty($params['event_id'])) { + $event_id = $params['event_id']; + } + if(!$this->_single && !empty($event_id)) { $duplicateContacts = 0; while(list($k,$dupeCheckContactId) = each($this->_contactIds)) { // Eliminate contacts that have already been assigned to this event. $dupeCheck = new CRM_Event_BAO_Participant; $dupeCheck->contact_id = $dupeCheckContactId; - $dupeCheck->event_id = $this->_eventId; + $dupeCheck->event_id = $event_id; $dupeCheck->find(TRUE); if(!empty($dupeCheck->id)) { $duplicateContacts++; -- 2.25.1