X-Git-Url: http://aleph1.co.uk/gitweb/?a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Fblock_content%2Fsrc%2FBlockContentForm.php;h=9df2a87d732ba519e3b97ef5fb5f53cc48a0eb5c;hb=5b8bb166bfa98770daef9de5c127fc2e6ef02340;hp=225dc91b4671bce46dd43f0c26a60d81e349b0c5;hpb=af6d1fb995500ae68849458ee10d66abbdcfb252;p=yaffs-website diff --git a/web/core/modules/block_content/src/BlockContentForm.php b/web/core/modules/block_content/src/BlockContentForm.php index 225dc91b4..9df2a87d7 100644 --- a/web/core/modules/block_content/src/BlockContentForm.php +++ b/web/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(); } }