From: Alexander Ebert Date: Tue, 21 Jan 2020 16:49:42 +0000 (+0100) Subject: Optional select fields were not optional because of a property mismatch X-Git-Tag: 5.2.2~41 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=73ef18a4853e11f02cce68ba51816981e2c5dfef;p=GitHub%2FWoltLab%2FWCF.git Optional select fields were not optional because of a property mismatch --- diff --git a/wcfsetup/install/files/lib/data/custom/option/CustomOption.class.php b/wcfsetup/install/files/lib/data/custom/option/CustomOption.class.php index dbed4ac1b9..851e0af319 100644 --- a/wcfsetup/install/files/lib/data/custom/option/CustomOption.class.php +++ b/wcfsetup/install/files/lib/data/custom/option/CustomOption.class.php @@ -39,6 +39,19 @@ abstract class CustomOption extends Option implements ITitledObject { */ protected $optionValue = ''; + /** + * @inheritDoc + */ + public function __get($name) { + // Some options support empty values, such as "select", but the code checks for the + // property `allowEmptyValue`, which is the inverse value of `required`. + if ($name === 'allowEmptyValue') { + return !$this->required; + } + + return parent::__get($name); + } + /** * @inheritDoc * @since 5.2