]> git.mxchange.org Git - friendica.git/commitdiff
Added check and repair for missing self contact
authorMichael <heluecht@pirati.ca>
Sat, 25 Apr 2020 07:29:38 +0000 (07:29 +0000)
committerMichael <heluecht@pirati.ca>
Sat, 25 Apr 2020 07:29:38 +0000 (07:29 +0000)
src/Model/User.php

index e7f2f89ad6f09bddcdb568fef7372710a0220f59..be71bcf64589a61c4d10fee982ae5e78fd6082d9 100644 (file)
@@ -197,7 +197,11 @@ class User
        {
                $owner = DBA::selectFirst('owner-view', [], ['uid' => $uid]);
                if (!DBA::isResult($owner)) {
-                       return false;
+                       if (!DBA::exists('user', ['uid' => $uid]) || !$check_valid) {
+                               return false;
+                       }
+                       Contact::createSelfFromUserId($uid);
+                       $owner = self::getOwnerDataById($uid, false);
                }
 
                if (empty($owner['nickname'])) {