Skip to content

Commit

Permalink
switch getUsername to getAccountName for d9 compatibility (#4325)
Browse files Browse the repository at this point in the history
  • Loading branch information
slayerment authored Sep 15, 2022
1 parent c9f1763 commit 60c4cf9
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/Command/Database/DatabaseLogBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ protected function createTableRow(\stdClass $dblog)
*/
if ($user = $this->userStorage->load($dblog->uid)) {
$user_id = $user->id();
$user_name = $user->getUsername();
$user_name = $user->getAccountName();
} else {
$user_id = $dblog->uid;
$user_name = $this->trans('commands.database.log.common.messages.user-deleted');
Expand Down
2 changes: 1 addition & 1 deletion src/Command/Debug/UserCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
$status = $user->isActive()?$this->trans('commands.common.status.enabled'):$this->trans('commands.common.status.disabled');
$tableRows[] = [
$userId,
$user->getUsername(),
$user->getAccountName(),
implode(', ', $userRoles),
$status
];
Expand Down
2 changes: 1 addition & 1 deletion src/Command/User/CreateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ private function createUser($username, $password, $roles, $email = null, $status

$result['success'] = [
'user-id' => $user->id(),
'username' => $user->getUsername(),
'username' => $user->getAccountName(),
'password' => $password,
'email' => $user->getEmail(),
'roles' => implode(', ', $roles),
Expand Down
6 changes: 3 additions & 3 deletions src/Command/User/DeleteCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
$this->getIo()->info(
sprintf(
$this->trans('commands.user.delete.messages.user-deleted'),
$userEntity->getUsername()
$userEntity->getAccountName()
)
);

Expand Down Expand Up @@ -161,9 +161,9 @@ protected function execute(InputInterface $input, OutputInterface $output)
foreach ($users as $user => $userEntity) {
try {
$userEntity->delete();
$tableRows['success'][] = [$user, $userEntity->getUsername()];
$tableRows['success'][] = [$user, $userEntity->getAccountName()];
} catch (\Exception $e) {
$tableRows['error'][] = [$user, $userEntity->getUsername()];
$tableRows['error'][] = [$user, $userEntity->getAccountName()];
$this->getIo()->error($e->getMessage());

return 1;
Expand Down
2 changes: 1 addition & 1 deletion src/Command/User/LoginCleanAttemptsCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
$this->getIo()->success(
sprintf(
$this->trans('commands.user.login.clear.attempts.messages.successful'),
$userEntity->getUsername()
$userEntity->getAccountName()
)
);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Command/User/LoginUrlCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
$this->getIo()->success(
sprintf(
$this->trans('commands.user.login.url.messages.url'),
$userEntity->getUsername()
$userEntity->getAccountName()
)
);

Expand Down
2 changes: 1 addition & 1 deletion src/Command/User/UserBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function getUsers()

$userList = [];
foreach ($users as $userId => $user) {
$userList[$userId] = $user->getUsername();
$userList[$userId] = $user->getAccountName();
}

return $userList;
Expand Down
2 changes: 1 addition & 1 deletion src/Utils/Create/UserData.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function create(

$users['success'][] = [
'user-id' => $user->id(),
'username' => $user->getUsername(),
'username' => $user->getAccountName(),
'roles' => implode(', ', $userRoles),
'created' => $this->dateFormatter->format(
$user->getCreatedTime(),
Expand Down

0 comments on commit 60c4cf9

Please sign in to comment.