summaryrefslogtreecommitdiffstats
path: root/core/modules/book
diff options
context:
space:
mode:
Diffstat (limited to 'core/modules/book')
-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
-rw-r--r--core/modules/book/tests/modules/book_test/book_test.module2
5 files changed, 8 insertions, 8 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());
}
diff --git a/core/modules/book/tests/modules/book_test/book_test.module b/core/modules/book/tests/modules/book_test/book_test.module
index 939e756..91da82c 100644
--- a/core/modules/book/tests/modules/book_test/book_test.module
+++ b/core/modules/book/tests/modules/book_test/book_test.module
@@ -17,6 +17,6 @@
function book_test_page_attachments(array &$page) {
$page['#cache']['tags'][] = 'book_test.debug_book_navigation_cache_context';
if (\Drupal::state()->get('book_test.debug_book_navigation_cache_context', FALSE)) {
- drupal_set_message(\Drupal::service('cache_contexts_manager')->convertTokensToKeys(['route.book_navigation'])->getKeys()[0]);
+ \Drupal::messenger()->addStatus(\Drupal::service('cache_contexts_manager')->convertTokensToKeys(['route.book_navigation'])->getKeys()[0]);
}
}