# Bug OP-18015 - Switching a multi select list cf to a single select cf of projects breaks opening the editing modal on the overview page

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

## Open points

_No work packages_

## Details

| Attribute | Value |
| --- | --- |
| Date |  |
| Priority | Medium |
| Module | Modules and project features / Project overview, Administration / Custom fields, Modules and project features / Project attributes |
| Target versions | 16.6.1 |
| Observed in versions | 16.5.0 |
| Sprint | 16.6.1 |
| Backlog bucket |  |
| Bug found in version (deprecated) | 16.5.x |
| 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 | Attila Dombi |
| Designer |  |
| Ordered by |  |
| Signed off by |  |
| Interest by |  |

## Planning

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

## Costs

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

## Description

### Steps to reproduce

1.  Have a list custom field / project attribute defined on projects
    
    1.  The list should allow selecting multiple values.

2.  Go to the overview page of a project having the list activated

3.  Edit the field in the overview page (opening the modal by clicking on the pen icon of the section the attribute is in)

4.  Within the administration, reconfigure the custom field to no longer allow multi selection

5.  Again, go to the overview page of the project before

6.  Click on the pen icon to open the modal for editing the field

### What is the buggy behavior?

  - The modal doesn't open

### What is the expected behavior?

1.  The modal opens

Additionally, if time permits:

1.  When switching the list from multi to single select in the administration, show a danger dialog upon saving. If confirmed, all values but the first are deleted for existing projects.

### **Logs**

<https://appsignal.com/openproject-gmbh/sites/6813715a55b0b20ed373597c/exceptions/incidents/1171>

``` text
undefined method 'errors' for an instance of Array

app/forms/custom_fields/inputs/base/input.rb:61 CustomFields::Inputs::Base::Input#invalid?

app/forms/custom_fields/inputs/base/utils.rb:40 CustomFields::Inputs::Base::Utils#base_input_attributes

app/forms/custom_fields/inputs/base/autocomplete/single_value_input.rb:33 CustomFields::Inputs::Base::Autocomplete::SingleValueInput#input_attributes

app/forms/custom_fields/inputs/single_user_select_list.rb:35 block in <class:SingleUserSelectList>

modules/overviews/app/components/overviews/project_custom_fields/edit_component.html.erb:11 block (2 levels) in Overviews::ProjectCustomFields::EditComponent#call

modules/overviews/app/components/overviews/project_custom_fields/edit_component.html.erb:4 block in Overviews::ProjectCustomFields::EditComponent#call

app/components/concerns/op_turbo/streamable.rb:125 OpTurbo::Streamable#component_wrapper

modules/overviews/app/components/overviews/project_custom_fields/edit_component.html.erb:3 Overviews::ProjectCustomFields::EditComponent#call

modules/overviews/app/components/overviews/project_custom_fields/edit_dialog_component.html.erb:11 block (2 levels) in Overviews::ProjectCustomFields::EditDialogComponent#call

modules/overviews/app/components/overviews/project_custom_fields/edit_dialog_component.html.erb:2 Overviews::ProjectCustomFields::EditDialogComponent#call

app/components/concerns/op_turbo/streamable.rb:68 OpTurbo::Streamable#render_as_turbo_stream

app/controllers/concerns/op_turbo/component_stream.rb:67 OpTurbo::ComponentStream#modify_via_turbo_stream

app/controllers/concerns/op_turbo/component_stream.rb:48 OpTurbo::ComponentStream#respond_with_dialog
```
