Defect #24484

Wrong order of rows with empty custom fields

Added by Ivan Zabrovskiy over 2 years ago.

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

0%

Category:Custom fields
Target version:-
Resolution: Affected version:

Description

Issues, sorted by custom field, appears in a countr-intuitive order. Issues with empty custom field goes before issues with any value.

Example (PostgreSQL, descending order):

Current result:

id Integer custom field (desc order)
143 <empty>
112 <empty>
95 2000
456 1900
73 1400

Expected result:

id Integer custom field (desc order)
95 2000
456 1900
73 1400
143 <empty>
112 <empty>

Solution: in Redmine::FieldFormat::Base in method join_for_order_statement (lib/redmine/field_format.rb line 279) remove row

" AND #{alias_name}.value <> ''" +

In this case, rows with empty custom field will be invoved in sorting and appear on proper places.

Also available in: Atom PDF