From e1786b67473d91d74031f9235b4e7f89cbdbd804 Mon Sep 17 00:00:00 2001 From: Michael Date: Thu, 12 Mar 2020 17:31:28 +0000 Subject: [PATCH 1/2] Avoid warning in gcontact.php --- src/Model/GContact.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Model/GContact.php b/src/Model/GContact.php index 59c84bc49..5bcac5a01 100644 --- a/src/Model/GContact.php +++ b/src/Model/GContact.php @@ -1343,14 +1343,18 @@ class GContact foreach ($contacts as $contact) { $gcontact = DBA::selectFirst('gcontact', ['id'], ['nurl' => Strings::normaliseLink(($contact))]); if (DBA::isResult($gcontact)) { + $field = []; if (in_array($contact, $followers)) { $fields = ['gcid' => $gcid, 'follower-gcid' => $gcontact['id']]; } elseif (in_array($contact, $followings)) { $fields = ['gcid' => $gcontact['id'], 'follower-gcid' => $gcid]; } - Logger::info('Set relation between contacts', $fields); - DBA::update('gfollower', ['deleted' => false], $fields, true); - continue; + + if (!empty($fields)) { + Logger::info('Set relation between contacts', $fields); + DBA::update('gfollower', ['deleted' => false], $fields, true); + continue; + } } if (!Network::isUrlBlocked($contact)) { From 505cca942b8facaaca416087b4ddd6647239e007 Mon Sep 17 00:00:00 2001 From: Michael Date: Thu, 12 Mar 2020 18:58:48 +0000 Subject: [PATCH 2/2] Fix wrong variable name --- src/Model/GContact.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Model/GContact.php b/src/Model/GContact.php index 5bcac5a01..2606edb9e 100644 --- a/src/Model/GContact.php +++ b/src/Model/GContact.php @@ -1343,7 +1343,7 @@ class GContact foreach ($contacts as $contact) { $gcontact = DBA::selectFirst('gcontact', ['id'], ['nurl' => Strings::normaliseLink(($contact))]); if (DBA::isResult($gcontact)) { - $field = []; + $fields = []; if (in_array($contact, $followers)) { $fields = ['gcid' => $gcid, 'follower-gcid' => $gcontact['id']]; } elseif (in_array($contact, $followings)) {