diff --git a/core/lib/Drupal/Core/Form/ConfigFormBase.php b/core/lib/Drupal/Core/Form/ConfigFormBase.php index e7878a7db0..707e580d5a 100644 --- a/core/lib/Drupal/Core/Form/ConfigFormBase.php +++ b/core/lib/Drupal/Core/Form/ConfigFormBase.php @@ -51,7 +51,7 @@ public function buildForm(array $form, FormStateInterface $form_state) { * {@inheritdoc} */ public function submitForm(array &$form, FormStateInterface $form_state) { - drupal_set_message($this->t('The configuration options have been saved.')); + $this->messenger()->addStatus($this->t('The configuration options have been saved.')); } } diff --git a/core/modules/block/tests/modules/block_test/src/Plugin/Block/TestContextAwareBlock.php b/core/modules/block/tests/modules/block_test/src/Plugin/Block/TestContextAwareBlock.php index 51f60b473a..70afd54cea 100644 --- a/core/modules/block/tests/modules/block_test/src/Plugin/Block/TestContextAwareBlock.php +++ b/core/modules/block/tests/modules/block_test/src/Plugin/Block/TestContextAwareBlock.php @@ -3,6 +3,7 @@ namespace Drupal\block_test\Plugin\Block; use Drupal\Core\Block\BlockBase; +use Drupal\Core\Messenger\MessengerTrait; use Drupal\Core\Session\AccountInterface; use Drupal\user\UserInterface; @@ -19,6 +20,8 @@ */ class TestContextAwareBlock extends BlockBase { + use MessengerTrait; + /** * {@inheritdoc} */ diff --git a/core/modules/filter/src/FilterFormatListBuilder.php b/core/modules/filter/src/FilterFormatListBuilder.php index 1739652e4a..f15474694d 100644 --- a/core/modules/filter/src/FilterFormatListBuilder.php +++ b/core/modules/filter/src/FilterFormatListBuilder.php @@ -53,6 +53,7 @@ public function __construct(EntityTypeInterface $entity_type, EntityStorageInter parent::__construct($entity_type, $storage); $this->configFactory = $config_factory; + $this->messenger = $messenger; } /**