From 7577274a27f566676be601099f9bde6e14e8fb44 Mon Sep 17 00:00:00 2001 From: Kirk Jackson Date: Tue, 10 Dec 2013 12:43:17 +0000 Subject: [PATCH] Allow Participant roles to be specified as an array --- CRM/Event/BAO/Participant.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CRM/Event/BAO/Participant.php b/CRM/Event/BAO/Participant.php index 2f26fe66aa..14faa1aee4 100644 --- a/CRM/Event/BAO/Participant.php +++ b/CRM/Event/BAO/Participant.php @@ -106,6 +106,11 @@ class CRM_Event_BAO_Participant extends CRM_Event_DAO_Participant { $params['fee_amount'] = CRM_Utils_Rule::cleanMoney($params['fee_amount']); } + // ensure that role ids are encoded as a string + if (is_array($params['role_id'])) { + $params['role_id'] = implode(CRM_Core_DAO::VALUE_SEPARATOR, $params['role_id']); + } + $participantBAO = new CRM_Event_BAO_Participant; if (CRM_Utils_Array::value('id', $params)) { $participantBAO->id = CRM_Utils_Array::value('id', $params); -- 2.25.1