Fix reference to username field in Contact::updateSelfFromUserID

- Profile isn't updated with the display name in the account settings
This commit is contained in:
Hypolite Petovan 2023-08-02 16:58:14 +02:00
parent 13cb8bb395
commit ecfbf317ae

View File

@ -799,7 +799,7 @@ class Contact
return false;
}
$fields = ['uid', 'nickname', 'page-flags', 'account-type', 'prvkey', 'pubkey'];
$fields = ['uid', 'username', 'nickname', 'page-flags', 'account-type', 'prvkey', 'pubkey'];
$user = DBA::selectFirst('user', $fields, ['uid' => $uid, 'account_expired' => false]);
if (!DBA::isResult($user)) {
return false;
@ -818,7 +818,7 @@ class Contact
$url = DI::baseUrl() . '/profile/' . $user['nickname'];
$fields = [
'name' => $profile['name'],
'name' => $user['username'],
'nick' => $user['nickname'],
'avatar-date' => $self['avatar-date'],
'location' => Profile::formatLocation($profile),
@ -841,7 +841,6 @@ class Contact
'confirm' => DI::baseUrl() . '/dfrn_confirm/' . $user['nickname'],
];
$avatar = Photo::selectFirst(['resource-id', 'type'], ['uid' => $uid, 'profile' => true]);
if (DBA::isResult($avatar)) {
if ($update_avatar) {