joomla-cms icon indicating copy to clipboard operation
joomla-cms copied to clipboard

Joomla\CMS\Installer\Installer\getParams ignores multiple=true setting

Open brbrbr opened this issue 1 year ago • 2 comments

Steps to reproduce the issue

The function getParams always initializes the values as 'string', for multiselect values this should be an array with the expanded values

brbrbr avatar Jul 13 '24 10:07 brbrbr

Could you give more context?

chmst avatar Aug 21 '24 14:08 chmst

given for example a config field in an extension xml file like:

<field multiple="true" default="1,2" ....> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> </field> The installation will set the default value to be a string in: https://github.com/joomla/joomla-cms/blob/22f8289d039c752409854e94d3fce75caf335be6/libraries/src/Installer/Installer.php#L1746C14-L1746C56 while for a multiple=true field it should be an array (explode on , from the string).

As a result, the extension will not use the desired default values.

brbrbr avatar Aug 21 '24 15:08 brbrbr