-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: user:settings
command when user is not available
#47889
base: master
Are you sure you want to change the base?
Conversation
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 <opensource@fthiessen.de>
/backport to stable30 |
if ($user !== null || $ignoreMissingUser === false) { | ||
// Only add the display name if the user exists (or is expected to exist) | ||
$settings['settings']['display_name'] = $user?->getDisplayName(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But simply changing for $user?->
would be enough, no?
All the rest of the PR is unnecessary to my understanding.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will wrongly output:
- core
- something: 1234
- settings
- display_name:
while with the current changes it correctly only lists the existing settings:
This will wrongly output:
- core
- something: 1234
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then just using if ($user !== null)
only would work? Why show the empty displayname when ignoreMissingUser is false?
Summary
If
ignore-missing-user
all sub commands work, except listing all settings for a user likeocc user:settings --ignore-missing-user user core
.Checklist