From 998f127cb83a12c3e4b626f2381a867988c8f5d2 Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 31 Jan 2021 12:26:25 +0000 Subject: [PATCH] Prevent "No post-content stored" --- src/Model/Item.php | 6 ++---- src/Model/Post/Content.php | 4 ---- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/src/Model/Item.php b/src/Model/Item.php index 7c507498b..6d882463f 100644 --- a/src/Model/Item.php +++ b/src/Model/Item.php @@ -1053,10 +1053,8 @@ class Item $notify_type = Delivery::POST; } - if (!in_array($item['verb'], self::ACTIVITIES) && !Post\Content::insert($item['uri-id'], $item)) { - // This shouldn't happen - Logger::warning('No post-content stored, quitting', ['guid' => $item['guid'], 'uri-id' => $item['uri-id'], 'causer-id' => ($item['causer-id'] ?? 0), 'post-type' => $item['post-type'], 'network' => $item['network']]); - return 0; + if (!in_array($item['verb'], self::ACTIVITIES)) { + Post\Content::insert($item['uri-id'], $item); } $body = $item['body']; diff --git a/src/Model/Post/Content.php b/src/Model/Post/Content.php index 5d9aaf62d..cdca7e8ca 100644 --- a/src/Model/Post/Content.php +++ b/src/Model/Post/Content.php @@ -44,10 +44,6 @@ class Content throw new BadMethodCallException('Empty URI_id'); } - if (DBA::exists('post-content', ['uri-id' => $uri_id])) { - return false; - } - $fields = DBStructure::getFieldsForTable('post-content', $data); // Additionally assign the key fields