From c055872164c7459b8d25caccc1220f15986d86ea Mon Sep 17 00:00:00 2001 From: =?utf8?q?Thomas=20Sch=C3=BCttler?= Date: Thu, 20 Oct 2016 15:09:55 +0200 Subject: [PATCH] CRM-19550 - CRM_Event_Form_Participant - Fix duplicate event registrations for standalone form --- CRM/Event/Form/Participant.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/CRM/Event/Form/Participant.php b/CRM/Event/Form/Participant.php index cd783ac251..cf8fe5a4bc 100644 --- a/CRM/Event/Form/Participant.php +++ b/CRM/Event/Form/Participant.php @@ -841,9 +841,15 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment } } // For single additions - show validation error if the contact has already been registered - // for this event with the same role. + // for this event. if ($self->_single && ($self->_action & CRM_Core_Action::ADD)) { - $contactId = $self->_contactId; + if ($self->_context == 'standalone') { + $contactId = CRM_Utils_Array::value('contact_id', $values); + } + else { + $contactId = $self->_contactId; + } + $eventId = CRM_Utils_Array::value('event_id', $values); if (!empty($contactId) && !empty($eventId)) { $dupeCheck = new CRM_Event_BAO_Participant(); -- 2.25.1