From: Cyperghost Date: Mon, 18 Nov 2024 13:49:36 +0000 (+0100) Subject: Set `parentCategoryName` in `save()` X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=refs%2Fheads%2F6.2-formbuilder-user-option;p=GitHub%2FWoltLab%2FWCF.git Set `parentCategoryName` in `save()` --- diff --git a/wcfsetup/install/files/lib/acp/form/UserOptionCategoryAddForm.class.php b/wcfsetup/install/files/lib/acp/form/UserOptionCategoryAddForm.class.php index 568ce03d27..043e583244 100644 --- a/wcfsetup/install/files/lib/acp/form/UserOptionCategoryAddForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/UserOptionCategoryAddForm.class.php @@ -46,11 +46,6 @@ class UserOptionCategoryAddForm extends AbstractFormBuilderForm */ public $objectEditLinkController = UserOptionCategoryEditForm::class; - /** - * @inheritDoc - */ - public $additionalFields = ['parentCategoryName' => 'profile']; - #[\Override] protected function createForm() { @@ -102,6 +97,16 @@ class UserOptionCategoryAddForm extends AbstractFormBuilderForm ); } + #[\Override] + public function save() + { + if ($this->formAction === 'create') { + $this->additionalFields['parentCategoryName'] = 'profile'; + } + + parent::save(); + } + #[\Override] public function saved() {