summaryrefslogtreecommitdiffstats
path: root/core/modules/user/src/Form/UserMultipleCancelConfirm.php
diff options
context:
space:
mode:
Diffstat (limited to 'core/modules/user/src/Form/UserMultipleCancelConfirm.php')
-rw-r--r--core/modules/user/src/Form/UserMultipleCancelConfirm.php3
1 files changed, 2 insertions, 1 deletions
diff --git a/core/modules/user/src/Form/UserMultipleCancelConfirm.php b/core/modules/user/src/Form/UserMultipleCancelConfirm.php
index b4487c2..b858d6a 100644
--- a/core/modules/user/src/Form/UserMultipleCancelConfirm.php
+++ b/core/modules/user/src/Form/UserMultipleCancelConfirm.php
@@ -5,6 +5,7 @@ namespace Drupal\user\Form;
use Drupal\Core\Entity\EntityManagerInterface;
use Drupal\Core\Form\ConfirmFormBase;
use Drupal\Core\Form\FormStateInterface;
+use Drupal\Core\Messenger\MessengerInterface;
use Drupal\Core\Url;
use Drupal\Core\TempStore\PrivateTempStoreFactory;
use Drupal\user\UserStorageInterface;
@@ -132,7 +133,7 @@ class UserMultipleCancelConfirm extends ConfirmFormBase {
if (isset($root)) {
$redirect = (count($accounts) == 1);
$message = $this->t('The user account %name cannot be canceled.', ['%name' => $root->label()]);
- drupal_set_message($message, $redirect ? 'error' : 'warning');
+ $this->messenger()->addMessage($message, $redirect ? MessengerInterface::TYPE_ERROR : MessengerInterface::TYPE_WARNING);
// If only user 1 was selected, redirect to the overview.
if ($redirect) {
return $this->redirect('entity.user.collection');