}
}
// 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();