core/lib/Drupal/Core/Form/ConfigFormBase.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/lib/Drupal/Core/Form/ConfigFormBase.php b/core/lib/Drupal/Core/Form/ConfigFormBase.php index c0e691a8fa..e76386c4f9 100644 --- a/core/lib/Drupal/Core/Form/ConfigFormBase.php +++ b/core/lib/Drupal/Core/Form/ConfigFormBase.php @@ -68,7 +68,8 @@ public function buildForm(array $form, FormStateInterface $form_state) { * {@inheritdoc} */ public function validateForm(array &$form, FormStateInterface $form_state) { - if (!in_array(ValidatableConfigFormTrait::class, class_uses($this))) { + // @see \Drupal\Core\Form\ValidatableConfigFormTrait + if (!method_exists($this, 'mapFormValuesToConfig')) { return; } @@ -144,7 +145,8 @@ public function validateForm(array &$form, FormStateInterface $form_state) { * {@inheritdoc} */ public function submitForm(array &$form, FormStateInterface $form_state) { - if (in_array(ValidatableConfigFormTrait::class, class_uses($this))) { + // @see \Drupal\Core\Form\ValidatableConfigFormTrait + if (method_exists($this, 'mapFormValuesToConfig')) { foreach ($this->getEditableConfigNames() as $config_name) { $config = $this->config($config_name); // @phpstan-ignore-next-line