Project

General

Profile

Defect #39714 » query_filter_group_fix.patch

Alexander Meindl, 2023-11-23 12:58

View differences:

app/helpers/queries_helper.rb
26 26
    ungrouped = []
27 27
    grouped = {label_string: [], label_date: [], label_time_tracking: [], label_attachment: []}
28 28
    query.available_filters.map do |field, field_options|
29
      if field =~ /^(.+)\./
29
      if /^cf_\d+\./.match?(field)
30
        group = (field_options[:through] || field_options[:field]).try(:name)
31
      elsif field =~ /^(.+)\./
30 32
        # association filters
31 33
        group = "field_#{$1}".to_sym
32 34
      elsif field_options[:type] == :relation
33 35
        group = :label_relations
34 36
      elsif field_options[:type] == :tree
35 37
        group = query.is_a?(IssueQuery) ? :label_relations : nil
36
      elsif /^cf_\d+\./.match?(field)
37
        group = (field_options[:through] || field_options[:field]).try(:name)
38 38
      elsif %w(member_of_group assigned_to_role).include?(field)
39 39
        group = :field_assigned_to
40 40
      elsif field_options[:type] == :date_past || field_options[:type] == :date
(1-1/2)