Read custom value
authorCyperghost <olaf_schmitz_1@t-online.de>
Mon, 18 Nov 2024 10:46:09 +0000 (11:46 +0100)
committerCyperghost <olaf_schmitz_1@t-online.de>
Mon, 18 Nov 2024 10:46:09 +0000 (11:46 +0100)
wcfsetup/install/files/lib/system/form/builder/field/BadgeColorFormField.class.php

index 7c2dd684d8ff8cef0e90bc73d58b0845d2dc902f..e1a433e8af259d2e602df45a3c9c0c564f37c78a 100644 (file)
@@ -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()
     {