Vote #78006
未完了Wrong order of rows with empty custom fields
0%
説明
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|
|112|
|95|2000|
|456|1900|
|73|1400|
Expected result:
|=. id|=. Integer custom field (desc order)|
|95|2000|
|456|1900|
|73|1400|
|143|
|112|
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.