diff --git a/core/modules/user/src/Plugin/Action/BlockUser.php b/core/modules/user/src/Plugin/Action/BlockUser.php index d32be18eac..16867a64ed 100644 --- a/core/modules/user/src/Plugin/Action/BlockUser.php +++ b/core/modules/user/src/Plugin/Action/BlockUser.php @@ -18,15 +18,14 @@ class BlockUser extends ActionBase { /** * {@inheritdoc} - * */ public function execute($account = NULL) { // Skip blocking user if they are already blocked. /** @var \Drupal\user\Entity\User $account */ if ($account !== FALSE && $account->isActive()) { // Check if user is trying to block own account. - if($account->id() === \Drupal::currentUser()->id()) { - drupal_set_message(t('You may not block your own account'),'warning'); + if ($account->id() === \Drupal::currentUser()->id()) { + drupal_set_message($this->t('You may not block your own account'), 'warning'); } else { // For efficiency manually save the original account before applying any