From 266fed1b996a1494942fe9e8207b159748e521d4 Mon Sep 17 00:00:00 2001 From: evazion Date: Wed, 28 Sep 2022 00:32:29 -0500 Subject: [PATCH] modqueue: fix incorrect page counts when filtering by tag. Fix a bug where the modqueue didn't show the correct page count when filtering by tag. Before we showed the total number of posts in the modqueue, instead of the actual number of posts for your search. This was for speed reasons, but with recent fixes it should be less of a problem to count the actual number of pages for the search. --- app/controllers/modqueue_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/modqueue_controller.rb b/app/controllers/modqueue_controller.rb index f4744b592..6ce24d3d9 100644 --- a/app/controllers/modqueue_controller.rb +++ b/app/controllers/modqueue_controller.rb @@ -8,7 +8,7 @@ class ModqueueController < ApplicationController authorize :modqueue @posts = Post.includes(:appeals, :disapprovals, :uploader, :media_asset, flags: [:creator]).available_for_moderation(CurrentUser.user, hidden: search_params[:hidden]) @modqueue_posts = @posts.reselect(nil).reorder(nil).offset(nil).limit(nil) - @posts = @posts.paginated_search(params, count_pages: true, count: @modqueue_posts.to_a.size, defaults: { order: "modqueue" }) + @posts = @posts.paginated_search(params, count_pages: true, defaults: { order: "modqueue" }) @pending_post_count = @modqueue_posts.select(&:is_pending?).count @flagged_post_count = @modqueue_posts.select(&:is_flagged?).count