Skip to content

Commit 099e50c

Browse files
committed
Remove the WYSIWYG option for contact form fields
1 parent cabf032 commit 099e50c

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

wcfsetup/install/files/lib/acp/form/ContactOptionAddForm.class.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@
77
use wcf\data\contact\option\ContactOptionList;
88
use wcf\system\form\builder\field\BooleanFormField;
99
use wcf\system\form\builder\field\MultilineTextFormField;
10+
use wcf\system\form\builder\field\SelectFormField;
1011
use wcf\system\form\builder\field\ShowOrderFormField;
1112
use wcf\system\form\builder\field\TextFormField;
13+
use wcf\system\form\option\FormOptionHandler;
1214

1315
/**
1416
* Shows the contact option add form.
@@ -69,6 +71,24 @@ protected function createForm()
6971
]);
7072
}
7173

74+
#[\Override]
75+
protected function getOptionTypeFormField(): SelectFormField
76+
{
77+
$formField = parent::getOptionTypeFormField();
78+
79+
// Remove the WYSIWYG type because the contact form does not support
80+
// embedded objects due to the unique behavior of it.
81+
$formField->options(
82+
\array_filter(
83+
FormOptionHandler::getInstance()->getSortedOptionTypes(),
84+
static fn($id) => $id !== "wysiwyg",
85+
\ARRAY_FILTER_USE_KEY,
86+
),
87+
);
88+
89+
return $formField;
90+
}
91+
7292
/**
7393
* @return array<int, string>
7494
*/

0 commit comments

Comments
 (0)