# Bug OP-9873 - Custom fields in project settings not sorted

Project: OpenProject
Status: closed
URL: https://community.openproject.org/work_packages/OP-9873

## Open points

_No work packages_

## Details

| Attribute | Value |
| --- | --- |
| Date |  |
| Priority | Medium |
| Module |  |
| Target versions | 12.1.5 |
| Observed in versions |  |
| Sprint | 12.1.5 |
| Backlog bucket |  |
| Bug found in version (deprecated) |  |
| Found in mobile app version |  |
| Follow-up feedback e-mail |  |
| Requires doc change | No |
| Accessibility | No |
| Pull preview |  |
| List |  |
| Labels |  |

## People

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

## Planning

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

## Costs

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

## Description

### **Environment**:

Your OpenProject Version: 12.1.0 / Docker

### **Steps to reproduce:**

1.  Go to project settings » custom fields

### **Actual Behaviour**

The custom fields are not sorted properly. They are sorted by created time (probably?) and not by name like in the creation panel Administration » Custom Fields

### **Expected Behaviour**

I think it would make more sense to sort the alphabetically like in the other admin interface.

The code in question would be: [https://github.com/opf/openproject/blob/b5bffe0f6d197173376fb6b392b839ffbb8ec49a/app/controllers/projects/settings/custom\_fields\_controller.rb](https://github.com/opf/openproject/blob/b5bffe0f6d197173376fb6b392b839ffbb8ec49a/app/controllers/projects/settings/custom_fields_controller.rb) line 35

This result is passed from the controller into the form at [https://github.com/opf/openproject/blob/23a8bef3523e55c039a7aa06aa80d2672d52f261/app/views/project\_settings/custom\_fields.html.erb](https://github.com/opf/openproject/blob/23a8bef3523e55c039a7aa06aa80d2672d52f261/app/views/project_settings/custom_fields.html.erb) line 56  
and then iterated here [https://github.com/opf/openproject/blob/23a8bef3523e55c039a7aa06aa80d2672d52f261/app/views/projects/form/\_custom\_fields.html.erb](https://github.com/opf/openproject/blob/23a8bef3523e55c039a7aa06aa80d2672d52f261/app/views/projects/form/_custom_fields.html.erb) line 71
