Issue Bug Closed

#92685Select with multiple values in site configuration not stored correctly

Chris Müller 10/22/20, 19:14 updated 05/11/21, 16:00

Description

Using a select type with renderTyp selectCheckBox in the sites configuration:

siteconfiguration_select.png

'myOptions' => [
    'label' => 'Options',
    'config' => [
        'type' => 'select',
        'renderType' => 'selectCheckBox',
        'items' => [
            ['Option A', 'option_a'],
            ['Option B', 'option_b'],
            ['Option C', 'option_c'],
            ['Option D', 'option_d'],
        ],
    ],
],

The options are stored in config.yaml as an array, e.g.:

myOptions:
  - option_a
  - option_b

But after saving the options are not activated in the form anymore. This is due the fact that for the renderTypes selectSingleBox, selectCheckBox and selectMultipleSideBySide the selected items are expected as a comma-separated list. So correct would be instead:

myOptions: 'option_a,option_b'

Reviews 2