From 6c792588fdb96b9cdd9053813cc759b481a55661 Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 8 May 2018 22:26:49 +0000 Subject: [PATCH] Ensure to mostly fetch the item with an non zero user id --- include/conversation.php | 2 +- mod/display.php | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/conversation.php b/include/conversation.php index 4a9d799d26..5b7ebb78a1 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -902,7 +902,7 @@ function conversation_add_children($parents, $block_authors, $order) { foreach ($parents AS $parent) { $thread_items = dba::p(item_query()."AND `item`.`parent-uri` = ? AND `item`.`uid` IN (0, ?) $block_sql - ORDER BY `item`.`commented` DESC" . $limit, + ORDER BY `item`.`uid` ASC, `item`.`commented` DESC" . $limit, $parent['uri'], local_user()); $comments = dba::inArray($thread_items); diff --git a/mod/display.php b/mod/display.php index eaf72c093f..13a0ba465f 100644 --- a/mod/display.php +++ b/mod/display.php @@ -344,10 +344,10 @@ function display_content(App $a, $update = false, $update_uid = 0) { } } - $r = dba::p(item_query()."AND `item`.`parent` = (SELECT `parent` FROM `item` WHERE `id` = ?) - $sql_extra - ORDER BY `parent` DESC, `gravity` ASC, `id` ASC", - $item_id + $r = dba::p(item_query()."AND `item`.`parent-uri` = (SELECT `parent-uri` FROM `item` WHERE `id` = ?) + AND `item`.`uid` IN (0, ?) $sql_extra + ORDER BY `item`.`uid` ASC, `parent` DESC, `gravity` ASC, `id` ASC", + $item_id, local_user() ); if (!DBM::is_result($r)) {