Uh oh!
There was an error while loading. Please reload this page.
fix: always use display name from correct backend - #39770
Conversation
c3058b0 to
cbc436eCompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
juliusknorr
commented
Aug 9, 2023
Looks sane, one thing I'll still want to double check is if this properly propagates to the system addressbook |
cbc436e to
136c804Compare| } | ||
| $account = $this->parseAccountData($user, $this->getUser($user)); | ||
| if ($user->getBackend() instanceof IGetDisplayNameBackend) { | ||
| $account->setProperty(self::PROPERTY_DISPLAYNAME, $user->getDisplayName()); |
There was a problem hiding this comment.
okay... so this would need a scope and verified parameter.
There was a problem hiding this comment.
We can just take the existing scope/verified parameter from the account object obtained earlier i think
There was a problem hiding this comment.
I now reuse the ones that were set on the original property from the account data as that mimics what the previous patch did.
I'm not sure that's what we want though. Given that we are getting the display name from the backend it's probably verified even if the display name in the original account data was not.
There was a problem hiding this comment.
I think we do not make any use of the verified parameter anyways for the displayname, the scope is user configured so it should be fine with this approach.
136c804 to
b78d2fcCompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
b78d2fc to
b72e979Compareb72e979 to
d3ce30cCompareOverwrite the display name after the account is initialized when using an instacne of IGetDisplayNameBackend. Before when using a variation of user_oidc and registering a Backend.php implementing IGetDisplayNameBackend the personal setting page shows 'uid'. The UserManager/AccountManager seems not to use consistently the correct backend. The correct backend is used in this sequence: server/lib/private/TemplateLayout.php $userDisplayName = \OC_User::getDisplayName(); $this->assign(user_displayname, $userDisplayName); In the settings page, it definitely not calls the registered backend, but seems to fall back to default Backend and shows (usually) uid or a value from the standard account property table. Signed-off-by: Max <max@nextcloud.com>
d3ce30c to
99a4a9cComparejuliusknorr
commented
Aug 16, 2023
Asking @Pytal and @ChristophWurst for review as I think both worked with that accounts code in the past |
max-nextcloud
commented
Aug 17, 2023
/backport to stable27 |
max-nextcloud
commented
Aug 17, 2023
/backport to stable26 |
max-nextcloud
commented
Aug 17, 2023
/backport to stable25 |
The backport to stable26 failed. Please do this backport manually. # Switch to the target branch and update it
git checkout stable26
git pull origin stable26
# Create the new backport branch
git checkout -b fix/foo-stable26
# Cherry pick the change from the commit sha1 of the change against the default branch# This might cause conflicts. Resolve them.
git cherry-pick abc123
# Push the cherry pick commit to the remote repository and open a pull request
git push origin fix/foo-stable26More info at https://docs.nextcloud.com/server/latest/developer_manual/getting_started/development_process.html#manual-backport |
The backport to stable25 failed. Please do this backport manually. # Switch to the target branch and update it
git checkout stable25
git pull origin stable25
# Create the new backport branch
git checkout -b fix/foo-stable25
# Cherry pick the change from the commit sha1 of the change against the default branch# This might cause conflicts. Resolve them.
git cherry-pick abc123
# Push the cherry pick commit to the remote repository and open a pull request
git push origin fix/foo-stable25More info at https://docs.nextcloud.com/server/latest/developer_manual/getting_started/development_process.html#manual-backport |
tsdicloud
commented
Aug 18, 2023
Perfect. You helped me to save some nerves for the next release! |
juliusknorr
commented
Aug 22, 2023
@max-nextcloud Can you take care of the manual backports? |
Overwrite the display name after the account is initialized when using an instacne of IGetDisplayNameBackend.
Before when using a variation of user_oidc and registering a Backend.php implementing IGetDisplayNameBackend
the personal setting page shows 'uid'.
The UserManager/AccountManager seems not to use consistently the correct backend.
The correct backend is used in this sequence:
server/lib/private/TemplateLayout.php
In the settings page, it definitely not calls the registered backend, but seems to fall back to default Backend and shows (usually) uid or a value from the standard account property table.
Summary
TODO
Checklist