From ae2288bc7dfe7f2cced967b6ee911bd317930ffa Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 11 May 2020 18:28:41 +0000 Subject: [PATCH] Fix "Uncaught TypeError: Argument 1 passed to :incrementQueueDone()" --- src/Worker/APDelivery.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Worker/APDelivery.php b/src/Worker/APDelivery.php index 609bb88886..92767a1058 100644 --- a/src/Worker/APDelivery.php +++ b/src/Worker/APDelivery.php @@ -68,13 +68,14 @@ class APDelivery } } - // This should never fail and is temporariy (until the move to ) + // This should never fail and is temporariy (until the move to the "post" structure) $item = Item::selectFirst(['uri-id'], ['id' => $target_id]); + $uriid = $item['uri-id'] ?? 0; if (!$success && !Worker::defer() && in_array($cmd, [Delivery::POST])) { - Post\DeliveryData::incrementQueueFailed($item['uri-id']); + Post\DeliveryData::incrementQueueFailed($uriid); } elseif ($success && in_array($cmd, [Delivery::POST])) { - Post\DeliveryData::incrementQueueDone($item['uri-id'], Post\DeliveryData::ACTIVITYPUB); + Post\DeliveryData::incrementQueueDone($uriid, Post\DeliveryData::ACTIVITYPUB); } } }