From 532a46d1886f431efb159818d5afa709b501f261 Mon Sep 17 00:00:00 2001 From: Hank Grabowski Date: Mon, 29 May 2023 14:03:16 -0400 Subject: [PATCH] Change selectOriginal post to return earliest post from non-0 user I believe the earliest entry not being uid=0 should be the original post of a reshared post --- src/Model/Post.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Model/Post.php b/src/Model/Post.php index 770ab08317..9e137ae379 100644 --- a/src/Model/Post.php +++ b/src/Model/Post.php @@ -263,7 +263,10 @@ class Post return $result; } - return self::selectFirst($original_fields, ['uri-id' => $result['thr-parent-id'], 'uid' => [0, $result['uid']]], $params); + $final_query_condition = ['uri-id' => $result['thr-parent-id']]; + $final_query_condition = DBA::mergeConditions($final_query_condition, ['uid != 0']); + $final_params = ['order' => ['id']]; + return self::selectFirst($original_fields, $final_query_condition, $final_params); } /**