Skip to content

Commit

Permalink
Add redmine patch to fix custom field filter group names
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandermeindl committed Nov 23, 2023
1 parent 46d9172 commit 0fb150f
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
3 changes: 3 additions & 0 deletions roles/redmine/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,8 @@ redmine_patches:
# strip: 1
- file: allowed_to_condition
strip: 1
- file: query_filter_group_fix
strip: 1

# set to yes, if git history for ssh is required on deploy
redmine_full_remote_deploy: false
Expand All @@ -264,6 +266,7 @@ redmine_write_permission_dirs:
# for additional_tags hint file
- path: /plugins

# https://api.rubyonrails.org/classes/ActiveJob/QueueAdapters/AsyncAdapter.html
# redmine_queue_adapter: async

redmine_async_queue_min_threads: 1
Expand Down
23 changes: 23 additions & 0 deletions roles/redmine/files/patches/query_filter_group_fix.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
diff --git a/app/helpers/queries_helper.rb b/app/helpers/queries_helper.rb
index b90f86457..d2505ff6f 100644
--- a/app/helpers/queries_helper.rb
+++ b/app/helpers/queries_helper.rb
@@ -26,15 +26,15 @@ module QueriesHelper
ungrouped = []
grouped = {label_string: [], label_date: [], label_time_tracking: [], label_attachment: []}
query.available_filters.map do |field, field_options|
- if field =~ /^(.+)\./
+ if /^cf_\d+\./.match?(field)
+ group = (field_options[:through] || field_options[:field]).try(:name)
+ elsif field =~ /^(.+)\./
# association filters
group = "field_#{$1}".to_sym
elsif field_options[:type] == :relation
group = :label_relations
elsif field_options[:type] == :tree
group = query.is_a?(IssueQuery) ? :label_relations : nil
- elsif /^cf_\d+\./.match?(field)
- group = (field_options[:through] || field_options[:field]).try(:name)
elsif %w(member_of_group assigned_to_role).include?(field)
group = :field_assigned_to
elsif field_options[:type] == :date_past || field_options[:type] == :date

0 comments on commit 0fb150f

Please sign in to comment.