From 5df1ead0012ab3226b5c9340ce41483d326a9d1e Mon Sep 17 00:00:00 2001 From: Michael Date: Fri, 1 Mar 2024 08:41:12 +0000 Subject: [PATCH] Issue 13953: Fix warning during postupdate --- src/Content/Item.php | 2 +- src/Model/Post/SearchIndex.php | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Content/Item.php b/src/Content/Item.php index c7438d2593..e9f4ef8738 100644 --- a/src/Content/Item.php +++ b/src/Content/Item.php @@ -695,7 +695,7 @@ class Item $item['body'] = Post\Media::addAttachmentsToBody($item['uri-id'], $item['body']); } - $shared_content = BBCode::getShareOpeningTag($item['author-name'], $item['author-link'], $item['author-avatar'], $item['plink'], $item['created'], $item['guid'], $item['uri']); + $shared_content = BBCode::getShareOpeningTag($item['author-name'], $item['author-link'], $item['author-avatar'], $item['plink'] ?? $item['uri'], $item['created'], $item['guid'], $item['uri']); if (!empty($item['title'])) { $shared_content .= '[h3]' . $item['title'] . "[/h3]\n"; diff --git a/src/Model/Post/SearchIndex.php b/src/Model/Post/SearchIndex.php index 554a1b90a7..7d215658df 100644 --- a/src/Model/Post/SearchIndex.php +++ b/src/Model/Post/SearchIndex.php @@ -48,6 +48,9 @@ class SearchIndex } $item = Post::selectFirstPost(['created', 'owner-id', 'private', 'language', 'network', 'title', 'content-warning', 'body', 'quote-uri-id'], ['uri-id' => $uri_id]); + if (empty($item)) { + return; + } $search = [ 'uri-id' => $uri_id,