Defect #32476

Sorting on multiple value fields is not working

Added by Taine Woo about 3 years ago. Updated about 3 years ago.

Status:NewStart date:
Priority:NormalDue date:
Assignee:-% Done:


Category:Issues list
Target version:-
Resolution: Affected version:4.0.3


Tested on Issues. Tested format of the Multiple value fields: Key/Value lists.
Sorting on single value fieds works fine, but totally not working on multiple value fields,


#1 Updated by Taine Woo about 3 years ago

The sorting by multiple value field is disabled by:
app\models\custom_field.rb, line 193:

  # Returns a ORDER BY clause that can used to sort customized
  # objects by their value of the custom field.
  # Returns nil if the custom field can not be used for sorting.
  def order_statement
    return nil if multiple?

But actually we can sorting by the multiple value allowed fields by:
1. order/sort the values of the multiple value allowed fields firstly, and generate the string;
2. order/sort by the field.

Also available in: Atom PDF