summaryrefslogtreecommitdiffstats
path: root/core/modules/block_content/src/BlockContentForm.php
diff options
context:
space:
mode:
Diffstat (limited to 'core/modules/block_content/src/BlockContentForm.php')
-rw-r--r--core/modules/block_content/src/BlockContentForm.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/core/modules/block_content/src/BlockContentForm.php b/core/modules/block_content/src/BlockContentForm.php
index 225dc91..9df2a87 100644
--- a/core/modules/block_content/src/BlockContentForm.php
+++ b/core/modules/block_content/src/BlockContentForm.php
@@ -54,11 +54,11 @@ class BlockContentForm extends ContentEntityForm {
if ($insert) {
$logger->notice('@type: added %info.', $context);
- drupal_set_message($this->t('@type %info has been created.', $t_args));
+ $this->messenger()->addStatus($this->t('@type %info has been created.', $t_args));
}
else {
$logger->notice('@type: updated %info.', $context);
- drupal_set_message($this->t('@type %info has been updated.', $t_args));
+ $this->messenger()->addStatus($this->t('@type %info has been updated.', $t_args));
}
if ($block->id()) {
@@ -83,7 +83,7 @@ class BlockContentForm extends ContentEntityForm {
else {
// In the unlikely case something went wrong on save, the block will be
// rebuilt and block form redisplayed.
- drupal_set_message($this->t('The block could not be saved.'), 'error');
+ $this->messenger()->addError($this->t('The block could not be saved.'));
$form_state->setRebuild();
}
}