From fff64c0490e68b0f1554f1aa9fa0be0bb4abc730 Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 23 Jun 2024 13:22:15 +0000 Subject: [PATCH] Fix missing links in posts --- src/Model/Post/Media.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Model/Post/Media.php b/src/Model/Post/Media.php index 39fc08ce27..7159591821 100644 --- a/src/Model/Post/Media.php +++ b/src/Model/Post/Media.php @@ -88,8 +88,8 @@ class Media // "document" has got the lowest priority. So when the same file is both attached as document // and embedded as picture then we only store the picture or replace the document $found = DBA::selectFirst('post-media', ['type'], ['uri-id' => $media['uri-id'], 'url' => $media['url']]); - if (!$force && !empty($found) && (($found['type'] != self::DOCUMENT) || ($media['type'] == self::DOCUMENT))) { - Logger::info('Media already exists', ['uri-id' => $media['uri-id'], 'url' => $media['url']]); + if (!$force && !empty($found) && (!in_array($found['type'], [self::UNKNOWN, self::DOCUMENT]) || ($media['type'] == self::DOCUMENT))) { + Logger::info('Media already exists', ['uri-id' => $media['uri-id'], 'url' => $media['url'], 'found' => $found['type'], 'new' => $media['type']]); return false; }