Invalid fields handling > Errors when query includes a deleted custom field

Description

When a custom field used in a list is deleted (Settings > Users > Custom fields), it breaks much of the functionality for that list.

Steps to reproduce:

  1. Create a single checkbox custom field in Settings > Users > Custom fields

  2. Go to the users app and select that custom field for one or more users

  3. Create a list where the query includes the single checkbox custom field created in step #1

  4. Make sure the single custom field is a visible column and save the list - everything should work as expected through this point

  5. Go to Settings > Users > Custom fields and delete the single checkbox custom field created in step #1

  6. Confirm deletion and delete the custom field

  7. Go back to the list created in step #3

  8. Without making any edits, the lists still loads, and the custom field column header still displays

  9. Click ‘Edit query’

Actual results:

  • An error occurs when the query builder is opened and the app freezes

Expected outcome:

  • The query builder loads with the query prepopulated

    • If a field cannot be prepopulated (it was deleted), it’s removed from the query

  • The query can be edited

  • If the user removes any query conditions referring to the missing custom field, the query can be tested / saved

  • If the user tests the query without removing conditions referring to the missing custom field, an error message is displayed

  • The app doesn’t freeze if the user clicks the ‘cancel’ button to close the query builder

Proposed dev approach from Zak Burke … it does not handle the situation where fieldOptions does not contain a matching fieldItem. Since it is permissible to remove custom fields, it feels like this is a straight up bug in the UI. Line 2 and everything after should be fenced off by a conditional like if (!!fieldItem) { ... } .

 

Current outcome when ‘Edit query’ is clicked

CSP Request Details

None

CSP Rejection Details

None

Potential Workaround

None

Attachments

9

Checklist

hide

Activity

Show:

Emma_Haroyan January 7, 2025 at 9:46 AM

Tested on Eureka ECS and OKAPI non-ECS envs.

Works as expected.

Kathleen Moore December 6, 2024 at 4:40 PM

Confirmed this is now working as expected on snapshot, okapi ECS snapshot, eureka ECS snapshot.

Emma_Haroyan December 6, 2024 at 1:55 PM

great thanks and I am unblocking the ticket and moving to ‘In review’

Kathleen Moore December 6, 2024 at 1:37 PM

and : here’s the modified field use case:

Khalilah Gambrell December 6, 2024 at 12:50 PM

Hey - this seems like a new use case to me - But, when we change the existing custom field name(renamed it), we see the same behaviour described above

and - what if we create a separate story for this use case? If so, Emma is this story still blocked?

Done

Details

Assignee

Reporter

Priority

Story Points

Sprint

Development Team

Fix versions

Release

RCA Group

Affected releases

Quesnelia (R1 2024)

TestRail: Cases

Open TestRail: Cases

TestRail: Runs

Open TestRail: Runs

Created February 16, 2024 at 3:25 PM
Updated January 7, 2025 at 9:46 AM
Resolved December 6, 2024 at 4:40 PM
TestRail: Cases
TestRail: Runs