Project

General

Profile

Actions

Defect #22808

closed

Malformed SQL query with SQLServer when grouping and sorting by fixed version

Added by Silvio Fernandes almost 8 years ago. Updated almost 8 years ago.

Status:
Closed
Priority:
Normal
Category:
Issues filter
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed
Affected version:

Description

Hi guys,

I had the same problem of issue #19544, but my was with the fixed version column, in version 3.2.1 with SQL Server 2012, and this r14207 did not solve my problem.

making a debug in the code, I found that the part where it should make a flatten between two Array, the variable group_by_sort_order comes as String, so I did a treatment to make this String into Array, and solved my problem.

code modified in /app/models/issue_query.rb

  # Returns the issues
  # Valid options are :order, :offset, :limit, :include, :conditions
  def issues(options={})
    if group_by_sort_order.is_a?(String)
      # convert String in Array
      order_option = [group_by_sort_order.split(','), options[:order]].flatten.reject(&:blank?)
    else
      order_option = [group_by_sort_order, options[:order]].flatten.reject(&:blank?)
    end

...


Files

issue_query.rb (23.5 KB) issue_query.rb file modified Silvio Fernandes, 2016-05-12 18:28
Actions

Also available in: Atom PDF