Size of multi select fields too small
authorKeitokun <keito1453@live.de>
Mon, 23 Mar 2020 16:35:33 +0000 (17:35 +0100)
committerMatthias Schmidt <gravatronics@live.com>
Fri, 27 Mar 2020 16:06:09 +0000 (17:06 +0100)
If you have 10 or less options in a multi select condition field and using option groups, the field size is always 1.

wcfsetup/install/files/lib/system/condition/AbstractMultiSelectCondition.class.php

index cf7ad2ecea2a2a906dc31bd0f8c24b5204758765..994e5114feab519b7b03c242278fdf85b61880bf 100644 (file)
@@ -36,7 +36,7 @@ abstract class AbstractMultiSelectCondition extends AbstractSelectCondition {
        protected function getFieldElement() {
                $options = $this->getOptions();
                
-               $fieldElement = '<select name="'.$this->fieldName.'[]" id="'.$this->fieldName.'" multiple size="'.(count($options, COUNT_RECURSIVE) > 10 ? 10 : count($options)).'">';
+               $fieldElement = '<select name="'.$this->fieldName.'[]" id="'.$this->fieldName.'" multiple size="'.(count($options, COUNT_RECURSIVE) > 10 ? 10 : count($options, COUNT_RECURSIVE)).'">';
                foreach ($options as $key => $value) {
                        if (is_array($value)) {
                                $fieldElement .= $this->getOptGroupCode($key, $value);