From: Kirk Jackson Date: Mon, 2 Dec 2013 15:26:21 +0000 (+0000) Subject: Allow Participant roles to be specified as an array X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=2c700d418d4f61cad84a8f1d220a7884ddac06d2;p=civicrm-core.git Allow Participant roles to be specified as an array --- 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);