diff --git a/advancedcontentfilter/advancedcontentfilter.php b/advancedcontentfilter/advancedcontentfilter.php index 7ecfda4e..c9285813 100644 --- a/advancedcontentfilter/advancedcontentfilter.php +++ b/advancedcontentfilter/advancedcontentfilter.php @@ -330,7 +330,7 @@ function advancedcontentfilter_post_rules(ServerRequestInterface $request) try { $fields = advancedcontentfilter_build_fields($data); } catch (Exception $e) { - throw new HTTPException\BadRequestException($e->getMessage(), $e); + throw new HTTPException\BadRequestException($e->getMessage(), 0, $e); } if (empty($fields['name']) || empty($fields['expression'])) { @@ -368,7 +368,7 @@ function advancedcontentfilter_put_rules_id(ServerRequestInterface $request, Res try { $fields = advancedcontentfilter_build_fields($data); } catch (Exception $e) { - throw new HTTPException\BadRequestException($e->getMessage(), $e); + throw new HTTPException\BadRequestException($e->getMessage(), 0, $e); } if (!DBA::update('advancedcontentfilter_rules', $fields, ['id' => $args['id']])) { diff --git a/advancedcontentfilter/src/middlewares.php b/advancedcontentfilter/src/middlewares.php index dffb9363..53026204 100644 --- a/advancedcontentfilter/src/middlewares.php +++ b/advancedcontentfilter/src/middlewares.php @@ -30,7 +30,7 @@ $container['errorHandler'] = function () { $responseCode = 500; if (is_a($exception, 'Friendica\Network\HTTPException')) { - $responseCode = $exception->getCode(); + $responseCode = $exception->httpcode; } $errors['message'] = $exception->getMessage(); diff --git a/pumpio/pumpio.php b/pumpio/pumpio.php index c6c492d4..b196167a 100644 --- a/pumpio/pumpio.php +++ b/pumpio/pumpio.php @@ -914,7 +914,7 @@ function pumpio_dounlike(App $a, $uid, $self, $post, $own_id) } } - Item::delete(['verb' => Activity::LIKE, 'uid' => $uid, 'contact-id' => $contactid, 'thr-parent' => $orig_post['uri']]); + Item::markForDeletion(['verb' => Activity::LIKE, 'uid' => $uid, 'contact-id' => $contactid, 'thr-parent' => $orig_post['uri']]); if (DBA::isResult($r)) { Logger::log("pumpio_dounlike: unliked existing like. User ".$own_id." ".$uid." Contact: ".$contactid." Url ".$orig_post['uri']); @@ -1082,13 +1082,13 @@ function pumpio_dodelete(App $a, $uid, $self, $post, $own_id) // Two queries for speed issues $condition = ['uri' => $post->object->id, 'uid' => $uid]; if (Item::exists($condition)) { - Item::delete($condition); + Item::markForDeletion($condition); return true; } $condition = ['extid' => $post->object->id, 'uid' => $uid]; if (Item::exists($condition)) { - Item::delete($condition); + Item::markForDeletion($condition); return true; } return false; diff --git a/twitter/twitter.php b/twitter/twitter.php index 5bd0206f..da8c3b36 100644 --- a/twitter/twitter.php +++ b/twitter/twitter.php @@ -808,8 +808,9 @@ function twitter_expire(App $a) return; } - $r = Item::select(['id'], ['deleted' => true, 'network' => Protocol::TWITTER]); + $r = Item::select(['id', 'guid'], ['deleted' => true, 'network' => Protocol::TWITTER]); while ($row = DBA::fetch($r)) { + Logger::info('[twitter] Delete expired item', ['id' => $row['id'], 'guid' => $row['guid'], 'callstack' => \Friendica\Core\System::callstack()]); DBA::delete('item', ['id' => $row['id']]); } DBA::close($r);