From 1be39f2b904ec7e2d289167eed760a6ac3400ccf Mon Sep 17 00:00:00 2001 From: Cyperghost Date: Mon, 18 Nov 2024 11:46:09 +0100 Subject: [PATCH] Read custom value --- .../builder/field/BadgeColorFormField.class.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/wcfsetup/install/files/lib/system/form/builder/field/BadgeColorFormField.class.php b/wcfsetup/install/files/lib/system/form/builder/field/BadgeColorFormField.class.php index 7c2dd684d8..e1a433e8af 100644 --- a/wcfsetup/install/files/lib/system/form/builder/field/BadgeColorFormField.class.php +++ b/wcfsetup/install/files/lib/system/form/builder/field/BadgeColorFormField.class.php @@ -86,6 +86,19 @@ final class BadgeColorFormField extends RadioButtonFormField implements IPattern } } + #[\Override] + public function value($value) + { + if (!\in_array($value, self::AVAILABLE_CSS_CLASSNAMES)) { + parent::value('custom'); + $this->customClassName = $value; + } else { + parent::value($value); + } + + return $this; + } + #[\Override] public function getSaveValue() { -- 2.20.1