summaryrefslogtreecommitdiffstats
path: root/core/modules/node/src/NodeForm.php
diff options
context:
space:
mode:
Diffstat (limited to 'core/modules/node/src/NodeForm.php')
-rw-r--r--core/modules/node/src/NodeForm.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/core/modules/node/src/NodeForm.php b/core/modules/node/src/NodeForm.php
index 0ad34ad..f775634 100644
--- a/core/modules/node/src/NodeForm.php
+++ b/core/modules/node/src/NodeForm.php
@@ -285,11 +285,11 @@ class NodeForm extends ContentEntityForm {
if ($insert) {
$this->logger('content')->notice('@type: added %title.', $context);
- drupal_set_message(t('@type %title has been created.', $t_args));
+ $this->messenger()->addStatus($this->t('@type %title has been created.', $t_args));
}
else {
$this->logger('content')->notice('@type: updated %title.', $context);
- drupal_set_message(t('@type %title has been updated.', $t_args));
+ $this->messenger()->addStatus($this->t('@type %title has been updated.', $t_args));
}
if ($node->id()) {
@@ -312,7 +312,7 @@ class NodeForm extends ContentEntityForm {
else {
// In the unlikely case something went wrong on save, the node will be
// rebuilt and node form redisplayed the same way as in preview.
- drupal_set_message(t('The post could not be saved.'), 'error');
+ $this->messenger()->addError($this->t('The post could not be saved.'));
$form_state->setRebuild();
}
}