Added update function to add user-contact entry

This commit is contained in:
Michael 2021-09-11 07:59:46 +00:00
parent f33a98578d
commit 5113987031
2 changed files with 9 additions and 1 deletions

View file

@ -56,7 +56,7 @@ class User
$pcontact = Contact::selectFirst(['id'], ['uri-id' => $contact['uri-id'], 'uid' => 0]); $pcontact = Contact::selectFirst(['id'], ['uri-id' => $contact['uri-id'], 'uid' => 0]);
if (!DBA::isResult($pcontact)) { if (!DBA::isResult($pcontact)) {
Logger::info('Public contact for user not found', ['uri-id' => $contact['uri-id'], 'uid' => $contact['uid'], 'cid' => $pcontact['id']]); Logger::info('Public contact for user not found', ['uri-id' => $contact['uri-id'], 'uid' => $contact['uid']]);
return false; return false;
} }

View file

@ -998,3 +998,11 @@ function update_1434()
return Update::SUCCESS; return Update::SUCCESS;
} }
function update_1435()
{
$contacts = DBA::select('contact', [], ["`uid` != ?", 0]);
while ($contact = DBA::fetch($contacts)) {
Contact\User::insertForContactArray($contact);
}
}