fix for single value for multi-select-fields passed by the api-explorer
authorThomas Leichtuss <leichtfuss@systopia.de>
Thu, 19 Nov 2015 09:18:42 +0000 (10:18 +0100)
committerThomas Leichtuss <leichtfuss@systopia.de>
Thu, 19 Nov 2015 09:18:42 +0000 (10:18 +0100)
CRM/Core/BAO/CustomField.php

index 6555a2dcf59d0d243c79f636be269185f6062111..08ac5c9c02f346c1c9807e65eedd82e54e44b40f 100644 (file)
@@ -1628,13 +1628,7 @@ SELECT id
       $customFields[$customFieldId]['html_type'] == 'AdvMulti-Select'
     ) {
       if ($value) {
-        // Note that only during merge this is not an array,
-        // and you can directly use value, CRM-4385
-        if (is_array($value)) {
-          $value = CRM_Core_DAO::VALUE_SEPARATOR . implode(CRM_Core_DAO::VALUE_SEPARATOR,
-              array_values($value)
-            ) . CRM_Core_DAO::VALUE_SEPARATOR;
-        }
+        $value = CRM_Utils_Array::implodePadded($value);
       }
       else {
         $value = '';