From: Michael Date: Sun, 19 Apr 2020 08:34:20 +0000 (+0000) Subject: Update item-uri with guid if given X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=98b3058601054fcb9f330a6990745fef8f1c3e1f;p=friendica.git Update item-uri with guid if given --- diff --git a/src/Model/ItemURI.php b/src/Model/ItemURI.php index 265585be7b..12e8d915df 100644 --- a/src/Model/ItemURI.php +++ b/src/Model/ItemURI.php @@ -42,13 +42,17 @@ class ItemURI DBA::insert('item-uri', $fields, true); } - $itemuri = DBA::selectFirst('item-uri', ['id'], ['uri' => $uri]); + $itemuri = DBA::selectFirst('item-uri', ['id', 'guid'], ['uri' => $uri]); if (!DBA::isResult($itemuri)) { // This shouldn't happen return null; } + if (empty($itemuri['guid']) && !empty($fields['guid'])) { + DBA::update('item-uri', ['guid' => $fields['guid']], ['id' => $itemuri['id']]); + } + return $itemuri['id']; }