From 51cd3128276afffb4c2a4cb243313b38bdb0c8ef Mon Sep 17 00:00:00 2001 From: Claudiu Cristea Date: Sat, 19 Feb 2022 20:24:34 +0200 Subject: [PATCH] PHP 8.1 deprecation messages when the user has no mail or uid --- src/Drupal/Commands/core/UserCommands.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Drupal/Commands/core/UserCommands.php b/src/Drupal/Commands/core/UserCommands.php index 23caeb9deb..09a168dd90 100644 --- a/src/Drupal/Commands/core/UserCommands.php +++ b/src/Drupal/Commands/core/UserCommands.php @@ -354,7 +354,7 @@ public function infoArray($account): array protected function getAccounts(string $names = '', array $options = []): array { $accounts = []; - if ($mails = StringUtils::csvToArray($options['mail'])) { + if (isset($options['mail']) && $mails = StringUtils::csvToArray($options['mail'])) { foreach ($mails as $mail) { if ($account = user_load_by_mail($mail)) { $accounts[$account->id()] = $account; @@ -363,7 +363,7 @@ protected function getAccounts(string $names = '', array $options = []): array } } } - if ($uids = StringUtils::csvToArray($options['uid'])) { + if (isset($options['uid']) && $uids = StringUtils::csvToArray($options['uid'])) { foreach ($uids as $uid) { if ($account = User::load($uid)) { $accounts[$account->id()] = $account;