# Bug SPPM-82 - Absent value for custom field is ordered not consistently at the beginning or end for different formats

Project: Stream Project Portfolio Management
Status: closed
URL: https://community.openproject.org/work_packages/SPPM-82

## Open points

_No work packages_

## Details

| Attribute | Value |
| --- | --- |
| Date |  |
| Priority | Medium |
| Module |  |
| Target versions | 15.1.0 |
| Observed in versions | 14.4.0 |
| Bug found in version (deprecated) | 14.4.x |
| Requires doc change | No |
| Accessibility | No |
| Pull preview |  |
| List |  |
| Labels |  |

## People

| Attribute | Value |
| --- | --- |
| Assignee |  |
| Accountable | Ivan Kuchin |
| Product manager |  |
| Developers |  |
| Designer |  |
| Ordered by |  |
| Signed off by |  |
| Interest by |  |

## Planning

| Attribute | Value |
| --- | --- |
| Relevance |  |

## Costs

| Attribute | Value |
| --- | --- |
| Votes |  |
| Work |  |
| Labor costs |  |

## Description

As an example if there are projects with values `a`, `b` and one without a value, should they be ordered like that or project without a value should be before those with values `a` and `b`? Default db behaviour is to put one without a value at the end, current behaviour for custom fields of most formats is to put it at the beginning. It may be a way to make ordering of empty string values and empty values consistent, which can be solved other way too. It is also different between projects and working packages:

For projects:  
Absent values are sorted before rest for `text`, `link`, `date`, `boolean`, `list` (only when multi value is allowed),&nbsp;  
Absent values are sorted after rest for `integer`, `float`, `list` (only when multi value is not allowed), `user`, `version`

For work packages:  
Absent values are sorted before rest for `text`, `link`, `integer`, `float`, `date`, `boolean`, `list` (only when multi value is allowed)  
Absent values are sorted after rest for `list` (only when multi value is not allowed), `user`, `version`

### Acceptance criteria:

*   When ordering ascending by any custom field, items without value should precede items with value/values
    
*   When ordering descending, items without value should follow items with value/values
    
*   Custom fields with format `boolean` currently display default value if it is unset
