The user_is_blocked function was deprecated in Drupal 10.3

Created on 28 May 2025, 15 days ago

Problem/Motivation

The user_is_blocked function was deprecated in Drupal 10.3. To resolve the issue, use Drupal\user\UserInterface::isBlocked instead.

https://api.drupal.org/api/drupal/core%21modules%21user%21user.module/fu...

Steps to reproduce

 ../vendor/bin/phpunit -c core ./modules/contrib/bakery/tests/ --group=bakery

Proposed resolution

@@ -76,8 +77,9 @@ class BakeryService {
    * @return bool
    *   TRUE if the login succeeds, FALSE otherwise.
    */
-  public function userExternalLogin(UserInterface $account) {
-    if (user_is_blocked($account->getAccountName())) {
+  public function userExternalLogin(UserInterface $account): bool {
+
+    if ($account->isBlocked()) {
       // Invalid login.
       return FALSE;

๐Ÿ› Bug report
Status

Active

Version

3.0

Component

Code

Created by

๐Ÿ‡ฆ๐Ÿ‡บAustralia purencool

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024