From 1898c0c351c8f559b59ccd087cead8d2c449d1e2 Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 20 Sep 2020 04:49:48 +0000 Subject: [PATCH 1/3] Fix notice "Undefined index: gravity" --- src/Protocol/ActivityPub/Receiver.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Protocol/ActivityPub/Receiver.php b/src/Protocol/ActivityPub/Receiver.php index ea5251438d..6910ee11c2 100644 --- a/src/Protocol/ActivityPub/Receiver.php +++ b/src/Protocol/ActivityPub/Receiver.php @@ -487,6 +487,10 @@ class Receiver $object_data['thread-completion'] = true; $item = ActivityPub\Processor::createItem($object_data); + if (empty($item)) { + return; + } + $item['post-type'] = Item::PT_ANNOUNCEMENT; ActivityPub\Processor::postItem($object_data, $item); From a42217eae4b503a1b7c1d9987b66c1ae5aa6afe8 Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 20 Sep 2020 07:45:19 +0000 Subject: [PATCH 2/3] Fixes notice "Undefined index: text" --- src/Content/PageInfo.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Content/PageInfo.php b/src/Content/PageInfo.php index d301c4d04d..8a2ee9f9d9 100644 --- a/src/Content/PageInfo.php +++ b/src/Content/PageInfo.php @@ -163,7 +163,7 @@ class PageInfo } } - $text .= ']' . $data['text'] . '[/attachment]'; + $text .= ']' . $data['text'] ?? '' . '[/attachment]'; $hashtags = ''; if (!empty($data['keywords'])) { From 12e74a70a4ca7194b1b4c5b2b4b0b243e0db2735 Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 20 Sep 2020 07:46:23 +0000 Subject: [PATCH 3/3] Added logging --- src/Protocol/ActivityPub/Processor.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Protocol/ActivityPub/Processor.php b/src/Protocol/ActivityPub/Processor.php index ec1404c0f9..2c99132c20 100644 --- a/src/Protocol/ActivityPub/Processor.php +++ b/src/Protocol/ActivityPub/Processor.php @@ -272,6 +272,7 @@ class Processor $item = self::processContent($activity, $item); if (empty($item)) { + Logger::info('Message was not processed'); return []; }