Merge pull request #18449 from colemanw/multiValueAutocomplete
authorSeamus Lee <seamuslee001@gmail.com>
Wed, 14 Oct 2020 09:06:05 +0000 (20:06 +1100)
committerGitHub <noreply@github.com>
Wed, 14 Oct 2020 09:06:05 +0000 (20:06 +1100)
Allow custom fields of type Autocomplete-Select to be multivalued

1  2 
CRM/Core/BAO/CustomField.php
tests/phpunit/CRM/Export/BAO/ExportTest.php
tests/phpunit/CRMTraits/Custom/CustomDataTrait.php

index 43b0588bac55a7ba1f3593eb72b31b641ab6d236,afba04879ba62bf0e0d2328a854a2bfc095a6528..66a5cf26a275db508f45062b4b2288da43220355
@@@ -890,10 -915,10 +890,10 @@@ class CRM_Core_BAO_CustomField extends 
          }
          else {
            // FIXME: This won't work with customFieldOptions hook
 -          $attributes += [
 +          $fieldAttributes += [
              'entity' => 'OptionValue',
              'placeholder' => $placeholder,
-             'multiple' => $search,
+             'multiple' => $search ? TRUE : !empty($field->serialize),
              'api' => [
                'params' => ['option_group_id' => $field->option_group_id, 'is_active' => 1],
              ],