From 544af76dda2810cb752fb343651849629cc81e1d Mon Sep 17 00:00:00 2001 From: Go MAEDA Date: Thu, 6 Apr 2023 10:08:48 +0000 Subject: Fixed an issue where an empty group could appear in the filter selection list caused by r22166 (#38402). git-svn-id: https://svn.redmine.org/redmine/trunk@22172 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/helpers/queries_helper.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'app/helpers/queries_helper.rb') diff --git a/app/helpers/queries_helper.rb b/app/helpers/queries_helper.rb index d6c6b59f4..20dae6fd4 100644 --- a/app/helpers/queries_helper.rb +++ b/app/helpers/queries_helper.rb @@ -52,6 +52,8 @@ module QueriesHelper ungrouped << [field_options[:name], field] end end + # Remove empty groups + grouped.delete_if {|k, v| v.empty?} # Don't group dates if there's only one (eg. time entries filters) if grouped[:label_date].try(:size) == 1 ungrouped << grouped.delete(:label_date).first -- cgit v1.2.3