fix_duplicated_order_by_columns.patch

proposed code fix - Olivier Houdas, 2016-09-15 15:01

Download (999 Bytes)

View differences:

app/models/issue_query.rb Thu Sep 15 15:01:02 2016 +0200
328 328

  
329 329
  # Returns the issues ids
330 330
  def issue_ids(options={})
331
    order_option = [group_by_sort_order, options[:order]].flatten.reject(&:blank?)
331
    group_by_with_options_sort_order = group_by_sort_order.map { |a| 
332
      i = options[:order].find_index { |b| (b.reverse.split(" ", 2).last == a.reverse.split(" ", 2).last) }
333
      i.nil? ? a : options[:order][i]
334
    }
335
    order_option = [group_by_with_options_sort_order, options[:order]].flatten.reject(&:blank?).uniq
332 336

  
333 337
    Issue.visible.
334 338
      joins(:status, :project).