]> git.mxchange.org Git - friendica.git/commitdiff
Ensure to mostly fetch the item with an non zero user id
authorMichael <heluecht@pirati.ca>
Tue, 8 May 2018 22:26:49 +0000 (22:26 +0000)
committerMichael <heluecht@pirati.ca>
Tue, 8 May 2018 22:26:49 +0000 (22:26 +0000)
include/conversation.php
mod/display.php

index 4a9d799d2691bf60b81cb75aca1c142b87dff7ca..5b7ebb78a182f3df45bd0ddfc744f5f2338cbff6 100644 (file)
@@ -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);
index eaf72c093ffb3b7a2a53962f8eaf0907d231c4f6..13a0ba465fd82eef78410158e802097fd0873370 100644 (file)
@@ -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)) {