summaryrefslogtreecommitdiffstats
path: root/app/helpers/queries_helper.rb
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2023-04-06 10:08:48 +0000
committerGo MAEDA <maeda@farend.jp>2023-04-06 10:08:48 +0000
commit544af76dda2810cb752fb343651849629cc81e1d (patch)
tree22c6ed038ad973652136901171b019310ab9e074 /app/helpers/queries_helper.rb
parent06c44910cfed55d3624cdc931687e6cde6c30090 (diff)
downloadredmine-544af76dda2810cb752fb343651849629cc81e1d.tar.gz
redmine-544af76dda2810cb752fb343651849629cc81e1d.zip
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
Diffstat (limited to 'app/helpers/queries_helper.rb')
-rw-r--r--app/helpers/queries_helper.rb2
1 files changed, 2 insertions, 0 deletions
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