]> git.mxchange.org Git - friendica.git/commitdiff
Ward against missing plink in createSharedBlockByArray
authorHypolite Petovan <hypolite@mrpetovan.com>
Mon, 3 Apr 2023 04:03:32 +0000 (00:03 -0400)
committerHypolite Petovan <hypolite@mrpetovan.com>
Mon, 3 Apr 2023 04:03:49 +0000 (00:03 -0400)
- Address https://github.com/friendica/friendica/issues/12486#issuecomment-1492984224
- Add logging to troubleshoot the issue

src/Model/Item.php

index af47b643cf4251955ae4519c1cbb39fe78d8f115..5ba8ae1bf2980725ed69bc98dfdc6d6b5ed63522 100644 (file)
@@ -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'])) {