summaryrefslogtreecommitdiffstats
path: root/core/modules/book/src
diff options
context:
space:
mode:
Diffstat (limited to 'core/modules/book/src')
-rw-r--r--core/modules/book/src/Controller/BookController.php2
-rw-r--r--core/modules/book/src/Form/BookAdminEditForm.php2
-rw-r--r--core/modules/book/src/Form/BookOutlineForm.php8
-rw-r--r--core/modules/book/src/Form/BookRemoveForm.php2
4 files changed, 7 insertions, 7 deletions
diff --git a/core/modules/book/src/Controller/BookController.php b/core/modules/book/src/Controller/BookController.php
index b92c3e3..fa34d92 100644
--- a/core/modules/book/src/Controller/BookController.php
+++ b/core/modules/book/src/Controller/BookController.php
@@ -154,7 +154,7 @@ class BookController extends ControllerBase {
// @todo Convert the custom export functionality to serializer.
if (!method_exists($this->bookExport, $method)) {
- drupal_set_message(t('Unknown export format.'));
+ $this->messenger()->addStatus(t('Unknown export format.'));
throw new NotFoundHttpException();
}
diff --git a/core/modules/book/src/Form/BookAdminEditForm.php b/core/modules/book/src/Form/BookAdminEditForm.php
index 66e717e..e052b7c 100644
--- a/core/modules/book/src/Form/BookAdminEditForm.php
+++ b/core/modules/book/src/Form/BookAdminEditForm.php
@@ -127,7 +127,7 @@ class BookAdminEditForm extends FormBase {
}
}
- drupal_set_message($this->t('Updated book %title.', ['%title' => $form['#node']->label()]));
+ $this->messenger()->addStatus($this->t('Updated book %title.', ['%title' => $form['#node']->label()]));
}
/**
diff --git a/core/modules/book/src/Form/BookOutlineForm.php b/core/modules/book/src/Form/BookOutlineForm.php
index f7ea043..1ce771e 100644
--- a/core/modules/book/src/Form/BookOutlineForm.php
+++ b/core/modules/book/src/Form/BookOutlineForm.php
@@ -113,7 +113,7 @@ class BookOutlineForm extends ContentEntityForm {
);
$book_link = $form_state->getValue('book');
if (!$book_link['bid']) {
- drupal_set_message($this->t('No changes were made'));
+ $this->messenger()->addStatus($this->t('No changes were made'));
return;
}
@@ -121,15 +121,15 @@ class BookOutlineForm extends ContentEntityForm {
if ($this->bookManager->updateOutline($this->entity)) {
if (isset($this->entity->book['parent_mismatch']) && $this->entity->book['parent_mismatch']) {
// This will usually only happen when JS is disabled.
- drupal_set_message($this->t('The post has been added to the selected book. You may now position it relative to other pages.'));
+ $this->messenger()->addStatus($this->t('The post has been added to the selected book. You may now position it relative to other pages.'));
$form_state->setRedirectUrl($this->entity->urlInfo('book-outline-form'));
}
else {
- drupal_set_message($this->t('The book outline has been updated.'));
+ $this->messenger()->addStatus($this->t('The book outline has been updated.'));
}
}
else {
- drupal_set_message($this->t('There was an error adding the post to the book.'), 'error');
+ $this->messenger()->addError($this->t('There was an error adding the post to the book.'));
}
}
diff --git a/core/modules/book/src/Form/BookRemoveForm.php b/core/modules/book/src/Form/BookRemoveForm.php
index f61aa77..2d5a919 100644
--- a/core/modules/book/src/Form/BookRemoveForm.php
+++ b/core/modules/book/src/Form/BookRemoveForm.php
@@ -103,7 +103,7 @@ class BookRemoveForm extends ConfirmFormBase {
public function submitForm(array &$form, FormStateInterface $form_state) {
if ($this->bookManager->checkNodeIsRemovable($this->node)) {
$this->bookManager->deleteFromBook($this->node->id());
- drupal_set_message($this->t('The post has been removed from the book.'));
+ $this->messenger()->addStatus($this->t('The post has been removed from the book.'));
}
$form_state->setRedirectUrl($this->getCancelUrl());
}