Skip to content

Commit

Permalink
Set parentCategoryName in save()
Browse files Browse the repository at this point in the history
  • Loading branch information
Cyperghost committed Nov 18, 2024
1 parent 46667f1 commit 687b5e7
Showing 1 changed file with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,6 @@ class UserOptionCategoryAddForm extends AbstractFormBuilderForm
*/
public $objectEditLinkController = UserOptionCategoryEditForm::class;

/**
* @inheritDoc
*/
public $additionalFields = ['parentCategoryName' => 'profile'];

#[\Override]
protected function createForm()
{
Expand Down Expand Up @@ -102,6 +97,16 @@ function (IFormDocument $document, array $data, IStorableObject $object) {
);
}

#[\Override]
public function save()
{
if ($this->formAction === 'create') {
$this->additionalFields['parentCategoryName'] = 'profile';
}

parent::save();
}

#[\Override]
public function saved()
{
Expand Down

0 comments on commit 687b5e7

Please sign in to comment.