]> git.mxchange.org Git - friendica.git/commitdiff
Fix reference to username field in Contact::updateSelfFromUserID
authorHypolite Petovan <hypolite@mrpetovan.com>
Wed, 2 Aug 2023 14:58:14 +0000 (16:58 +0200)
committerHypolite Petovan <hypolite@mrpetovan.com>
Wed, 2 Aug 2023 14:58:14 +0000 (16:58 +0200)
- Profile isn't updated with the display name in the account settings

src/Model/Contact.php

index 3ca84515a9af54d71b4d05d8999c43d46f2e8bd7..17be0b0cfdfc7e335162c5d8f04aeebc9c5349ad 100644 (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) {