From 9eccfb7b5200cb35014606c6e85585e7a08586bb Mon Sep 17 00:00:00 2001 From: Roman Rizzi Date: Tue, 3 Dec 2019 04:39:10 -0300 Subject: [PATCH] FIX: Guarantee order to correctly defer replies in review queue (#8426) Our code used to approve the first flagged post and ignore the rest in some specific conditions. --- app/controllers/posts_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/posts_controller.rb b/app/controllers/posts_controller.rb index dd4b78e7561..c28102530cd 100644 --- a/app/controllers/posts_controller.rb +++ b/app/controllers/posts_controller.rb @@ -335,7 +335,7 @@ class PostsController < ApplicationController params.require(:post_ids) agree_with_first_reply_flag = (params[:agree_with_first_reply_flag] || true).to_s == "true" - posts = Post.where(id: post_ids_including_replies) + posts = Post.where(id: post_ids_including_replies).order(:id) raise Discourse::InvalidParameters.new(:post_ids) if posts.blank? # Make sure we can delete the posts