diff --git a/core/lib/Drupal/Core/Form/ConfigFormBase.php b/core/lib/Drupal/Core/Form/ConfigFormBase.php index 9781f34f99..cc0b002d84 100644 --- a/core/lib/Drupal/Core/Form/ConfigFormBase.php +++ b/core/lib/Drupal/Core/Form/ConfigFormBase.php @@ -53,7 +53,7 @@ public function buildForm(array $form, FormStateInterface $form_state) { * {@inheritdoc} */ public function submitForm(array &$form, FormStateInterface $form_state) { - $this->messenger->addStatus($this->t('The configuration options have been saved.')); + $this->messenger()->addStatus($this->t('The configuration options have been saved.')); } } diff --git a/core/lib/Drupal/Core/Form/FormErrorHandler.php b/core/lib/Drupal/Core/Form/FormErrorHandler.php index 88ec061aa4..511fe7bc4d 100644 --- a/core/lib/Drupal/Core/Form/FormErrorHandler.php +++ b/core/lib/Drupal/Core/Form/FormErrorHandler.php @@ -41,7 +41,7 @@ protected function displayErrorMessages(array $form, FormStateInterface $form_st // Loop through all form errors and set an error message. foreach ($errors as $error) { - $this->messenger->addError($error); + $this->messenger()->addError($error); } }