Explode return values if it is not already an array.
authorThomas <tschuettler@oxfam.de>
Tue, 31 Jul 2018 14:13:01 +0000 (16:13 +0200)
committerThomas <tschuettler@oxfam.de>
Tue, 31 Jul 2018 14:13:01 +0000 (16:13 +0200)
api/v3/CustomValue.php

index e53b39d88a7013c0676cd738c8d50b730ed3012d..3a855d21f3106ac1e27d6bbc8f12269efc096db7 100644 (file)
@@ -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;