From: Hypolite Petovan Date: Mon, 3 Apr 2023 04:03:32 +0000 (-0400) Subject: Ward against missing plink in createSharedBlockByArray X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=c673c478eec1889a4ddc0fa0036d8b1764dcf1e3;p=friendica.git Ward against missing plink in createSharedBlockByArray - Address https://github.com/friendica/friendica/issues/12486#issuecomment-1492984224 - Add logging to troubleshoot the issue --- diff --git a/src/Model/Item.php b/src/Model/Item.php index af47b643cf..5ba8ae1bf2 100644 --- a/src/Model/Item.php +++ b/src/Model/Item.php @@ -3042,7 +3042,11 @@ class Item } if (!empty($quote_uri_id)) { - $item['body'] .= "\n" . DI::contentItem()->createSharedBlockByArray($shared_item); + if (isset($shared_item['plink'])) { + $item['body'] .= "\n" . DI::contentItem()->createSharedBlockByArray($shared_item); + } else { + DI::logger()->warning('Missing plink in shared item', ['item' => $item, 'shared' => $shared, 'quote_uri_id' => $quote_uri_id, 'shared_item' => $shared_item]); + } } if (!empty($shared_item['uri-id'])) {