From: Hypolite Petovan Date: Thu, 11 Jan 2018 01:13:51 +0000 (-0500) Subject: Fix selectFirst usage in Model\Contact X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=3f078d81cecb176ee9d21e4b3638da6b972b7782;p=friendica.git Fix selectFirst usage in Model\Contact --- diff --git a/src/Model/Contact.php b/src/Model/Contact.php index 2323c583b4..d92d4dd1d2 100644 --- a/src/Model/Contact.php +++ b/src/Model/Contact.php @@ -1246,15 +1246,13 @@ class Contact extends BaseObject ); } - $r = dba::selectFirst('contact', ['url' => $ret['url'], 'network' => $ret['network'], 'uid' => $uid]); - - if (!DBM::is_result($r)) { + $contact = dba::selectFirst('contact', [], ['url' => $ret['url'], 'network' => $ret['network'], 'uid' => $uid]); + if (!DBM::is_result($contact)) { $result['message'] .= t('Unable to retrieve contact information.') . EOL; return $result; } - $contact = $r; - $contact_id = $r['id']; + $contact_id = $contact['id']; $result['cid'] = $contact_id; Group::addMember(User::getDefaultGroup($uid, $contact["network"]), $contact_id);