From 55000cc71e570d72abbedba1370b9de55076cf72 Mon Sep 17 00:00:00 2001 From: Thomas Date: Tue, 31 Jul 2018 16:13:01 +0200 Subject: [PATCH] Explode return values if it is not already an array. --- api/v3/CustomValue.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/api/v3/CustomValue.php b/api/v3/CustomValue.php index e53b39d88a..3a855d21f3 100644 --- a/api/v3/CustomValue.php +++ b/api/v3/CustomValue.php @@ -149,7 +149,10 @@ function civicrm_api3_custom_value_get($params) { if (!empty(substr($id, 7))) { $returnVal = substr($id, 7); } - foreach ((array) $returnVal as $value) { + if (!is_array($returnVal)) { + $returnVal = explode(',', $returnVal); + } + foreach ($returnVal as $value) { list($c, $i) = CRM_Utils_System::explode('_', $value, 2); if ($c == 'custom' && is_numeric($i)) { $names['custom_' . $i] = 'custom_' . $i; -- 2.25.1