From b1eb87b84efa8cacbc5f7471bc6d993452db2402 Mon Sep 17 00:00:00 2001 From: monishdeb Date: Wed, 26 Aug 2015 18:21:16 +0530 Subject: [PATCH] minor changes for partcipant.Get --- CRM/Contact/BAO/Query.php | 5 +++-- api/v3/Participant.php | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CRM/Contact/BAO/Query.php b/CRM/Contact/BAO/Query.php index c643f9edeb..f9efcaaf50 100644 --- a/CRM/Contact/BAO/Query.php +++ b/CRM/Contact/BAO/Query.php @@ -5483,10 +5483,11 @@ AND displayRelType.is_active = 1 * * @param CRM_Core_DAO $dao * @param bool $return + * @param bool $usedForAPI * * @return array|NULL */ - public function convertToPseudoNames(&$dao, $return = FALSE) { + public function convertToPseudoNames(&$dao, $return = FALSE, $usedForAPI = FALSE) { if (empty($this->_pseudoConstantsSelect)) { return NULL; } @@ -5528,7 +5529,7 @@ AND displayRelType.is_active = 1 $viewValues[$k] = $pseudoOptions[$v]; } } - $dao->$key = implode(', ', $viewValues); + $dao->$key = ($usedForAPI && count($viewValues) > 1) ? $viewValues : implode(', ', $viewValues); } else { $labels = CRM_Core_OptionGroup::values($value['pseudoField']); diff --git a/api/v3/Participant.php b/api/v3/Participant.php index 19442ceb79..20997ea064 100644 --- a/api/v3/Participant.php +++ b/api/v3/Participant.php @@ -163,7 +163,7 @@ function civicrm_api3_participant_get($params) { $participant = array(); while ($dao->fetch()) { - $query->convertToPseudoNames($dao); + $query->convertToPseudoNames($dao, FALSE, TRUE); $participant[$dao->participant_id] = $query->store($dao); //@todo - is this required - contribution & pledge use the same query but don't self-retrieve custom data _civicrm_api3_custom_data_get($participant[$dao->participant_id], 'Participant', $dao->participant_id, NULL); -- 2.25.1