Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix: user:settings command when user is not available
If `ignore-missing-user` all sub commands work, except listing all settings
for a user like `occ user:settings --ignore-missing-user user core`.

Signed-off-by: Ferdinand Thiessen <[email protected]>
  • Loading branch information
susnux authored and skjnldsv committed Jan 28, 2025
commit 00286eefa819110ec88c05a5e115690f4f7a7cba
7 changes: 5 additions & 2 deletions core/Command/User/Setting.php
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
}
}

protected function getUserSettings($uid, $app) {
protected function getUserSettings(string $uid, string $app): array {
$settings = $this->config->getAllUserValues($uid);
if ($app !== '') {
if (isset($settings[$app])) {
Expand All @@ -230,7 +230,10 @@ protected function getUserSettings($uid, $app) {
}

$user = $this->userManager->get($uid);
$settings['settings']['display_name'] = $user->getDisplayName();
if ($user !== null) {
// Only add the display name if the user exists
$settings['settings']['display_name'] = $user->getDisplayName();
}

return $settings;
}
Expand Down
Loading