Skip to content

Commit 60c4cf9

Browse files
authored
switch getUsername to getAccountName for d9 compatibility (#4325)
1 parent c9f1763 commit 60c4cf9

8 files changed

Lines changed: 10 additions & 10 deletions

File tree

src/Command/Database/DatabaseLogBase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ protected function createTableRow(\stdClass $dblog)
218218
*/
219219
if ($user = $this->userStorage->load($dblog->uid)) {
220220
$user_id = $user->id();
221-
$user_name = $user->getUsername();
221+
$user_name = $user->getAccountName();
222222
} else {
223223
$user_id = $dblog->uid;
224224
$user_name = $this->trans('commands.database.log.common.messages.user-deleted');

src/Command/Debug/UserCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
157157
$status = $user->isActive()?$this->trans('commands.common.status.enabled'):$this->trans('commands.common.status.disabled');
158158
$tableRows[] = [
159159
$userId,
160-
$user->getUsername(),
160+
$user->getAccountName(),
161161
implode(', ', $userRoles),
162162
$status
163163
];

src/Command/User/CreateCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ private function createUser($username, $password, $roles, $email = null, $status
246246

247247
$result['success'] = [
248248
'user-id' => $user->id(),
249-
'username' => $user->getUsername(),
249+
'username' => $user->getAccountName(),
250250
'password' => $password,
251251
'email' => $user->getEmail(),
252252
'roles' => implode(', ', $roles),

src/Command/User/DeleteCommand.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
126126
$this->getIo()->info(
127127
sprintf(
128128
$this->trans('commands.user.delete.messages.user-deleted'),
129-
$userEntity->getUsername()
129+
$userEntity->getAccountName()
130130
)
131131
);
132132

@@ -161,9 +161,9 @@ protected function execute(InputInterface $input, OutputInterface $output)
161161
foreach ($users as $user => $userEntity) {
162162
try {
163163
$userEntity->delete();
164-
$tableRows['success'][] = [$user, $userEntity->getUsername()];
164+
$tableRows['success'][] = [$user, $userEntity->getAccountName()];
165165
} catch (\Exception $e) {
166-
$tableRows['error'][] = [$user, $userEntity->getUsername()];
166+
$tableRows['error'][] = [$user, $userEntity->getAccountName()];
167167
$this->getIo()->error($e->getMessage());
168168

169169
return 1;

src/Command/User/LoginCleanAttemptsCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
107107
$this->getIo()->success(
108108
sprintf(
109109
$this->trans('commands.user.login.clear.attempts.messages.successful'),
110-
$userEntity->getUsername()
110+
$userEntity->getAccountName()
111111
)
112112
);
113113
}

src/Command/User/LoginUrlCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
103103
$this->getIo()->success(
104104
sprintf(
105105
$this->trans('commands.user.login.url.messages.url'),
106-
$userEntity->getUsername()
106+
$userEntity->getAccountName()
107107
)
108108
);
109109

src/Command/User/UserBase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public function getUsers()
6161

6262
$userList = [];
6363
foreach ($users as $userId => $user) {
64-
$userList[$userId] = $user->getUsername();
64+
$userList[$userId] = $user->getAccountName();
6565
}
6666

6767
return $userList;

src/Utils/Create/UserData.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public function create(
6262

6363
$users['success'][] = [
6464
'user-id' => $user->id(),
65-
'username' => $user->getUsername(),
65+
'username' => $user->getAccountName(),
6666
'roles' => implode(', ', $userRoles),
6767
'created' => $this->dateFormatter->format(
6868
$user->getCreatedTime(),

0 commit comments

Comments
 (0)