From 46c4bd9099648de4269e41460f8ebf8927c9ecd0 Mon Sep 17 00:00:00 2001 From: Hugo Sales Date: Sun, 27 Feb 2022 21:14:33 +0000 Subject: [PATCH] [COMPONENT][Conversation] Sort conversation correctly --- .../Conversation/Controller/Conversation.php | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/components/Conversation/Controller/Conversation.php b/components/Conversation/Controller/Conversation.php index c40806406a..b11ca7199d 100644 --- a/components/Conversation/Controller/Conversation.php +++ b/components/Conversation/Controller/Conversation.php @@ -62,8 +62,11 @@ class Conversation extends FeedController $page_title = _m('Conversation'); return [ - '_template' => 'collection/notes.html.twig', - 'notes' => $this->query(query: "note-conversation:{$conversation_id}")['notes'] ?? [], + '_template' => 'collection/notes.html.twig', + 'notes' => $this->query( + query: "note-conversation:{$conversation_id}", + note_order_by: ['note.created' => 'ASC', 'note.id' => 'ASC'], + )['notes'] ?? [], 'should_format' => false, 'page_title' => $page_title, 'notes_feed_title' => (new Heading(1, [], $page_title)), @@ -138,9 +141,12 @@ class Conversation extends FeedController return [ '_template' => 'conversation/mute.html.twig', - 'notes' => $this->query(query: "note-conversation:{$conversation_id}")['notes'] ?? [], - 'is_muted' => $is_muted, - 'form' => $form->createView(), + 'notes' => $this->query( + query: "note-conversation:{$conversation_id}", + note_order_by: ['note.created' => 'ASC', 'note.id' => 'ASC'], + )['notes'] ?? [], + 'is_muted' => $is_muted, + 'form' => $form->createView(), ]; } }