From d58103a80e906c71e448b8e7b6b0ff7447fb0bf0 Mon Sep 17 00:00:00 2001 From: Matthias Pfefferle Date: Wed, 29 Jan 2025 14:47:45 +0100 Subject: [PATCH] fix tests --- includes/rest/class-outbox-controller.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/includes/rest/class-outbox-controller.php b/includes/rest/class-outbox-controller.php index f2c1f80c6..5a475f5bd 100644 --- a/includes/rest/class-outbox-controller.php +++ b/includes/rest/class-outbox-controller.php @@ -233,13 +233,14 @@ public function get_items( $request ) { * @return array Response object on success, or WP_Error object on failure. */ public function prepare_item_for_response( $item, $request ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable - $type = \get_post_meta( $item->ID, '_activitypub_activity_type', true ); + $type = \get_post_meta( $item->ID, '_activitypub_activity_type', true ); + $activity = new Activity(); $activity->set_type( $type ); $activity->set_id( $item->guid ); // Pre-fill the Activity with data (for example cc and to). $activity->set_object( \json_decode( $item->post_content, true ) ); - $activity->set_actor( Actors::get_by_id( $item->post_author )->get_id() ); + $activity->set_actor( Actors::get_by_various( $request->get_param( 'user_id' ) )->get_id() ); return $activity->to_array( false ); }