Fix setting value of multiple selection form field
authorMatthias Schmidt <gravatronics@live.com>
Sat, 13 Oct 2018 09:46:29 +0000 (11:46 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Sat, 13 Oct 2018 09:46:29 +0000 (11:46 +0200)
See #2509

wcfsetup/install/files/lib/system/form/builder/field/MultipleSelectionFormField.class.php

index f30ece0394b6ddd1fee82e814287f4cf36f50317..3dd841f580144d6579258b15e7783c34286cd816 100644 (file)
@@ -66,7 +66,7 @@ class MultipleSelectionFormField extends AbstractFormField implements INullableF
                        throw new \InvalidArgumentException("Given value is no array, " . gettype($value) . " given.");
                }
                
-               $unknownValues = array_diff($this->getValue(), array_keys($this->getOptions()));
+               $unknownValues = array_diff($value, array_keys($this->getOptions()));
                if (!empty($unknownValues)) {
                        throw new \InvalidArgumentException("Unknown values '" . implode("', '", $unknownValues) . '"');
                }