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

Description

When a custom field used in a list is modified (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 modify the the single checkbox custom field created in step #1

  6. Confirm changes and save 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

    Edit query

    • If the user edits the query then

      • Query box:

        • Display a warning toast. Message to display is - {fieldName} in your query is unavailable. Please revise your query.

      • Run & Save query button is disabled until the user removes all deleted fields.

      • Test query button is disabled until the user removes all deleted fields

      • Show columns should not display any deleted fields

    • Once user removes all deleted fields from the query then they should be able to test and save the revised query and list.

    • And the actions that previously generated an error toast notification should now work as expected on Edit/View List detail records.

    • Show column should not display any deleted field as an option

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

10

Checklist

hide

Activity

Show:

Emma_HaroyanJanuary 11, 2025 at 2:43 PM

Tested on OKAPI bugfest.

Works as expected.

Oleksii PetrenkoJanuary 10, 2025 at 5:53 PM

Deployed to R bugfest

Kathleen MooreJanuary 9, 2025 at 7:09 PM

confirmed this is working as expected

Emma_HaroyanJanuary 5, 2025 at 6:06 PM

all good to me as well. Thanks for checking.

Kathleen MooreDecember 9, 2024 at 3:30 PM

- reviewed on snapshot today - this might actually be working as expected. did you have a different experience and/or expectation? here’s what I observed:

  1. Create a list where the query uses a custom field

  2. Update the custom field name and save

  3. Return to list and edit query

    1. if the custom field cache hasn’t updated (takes ~5 minutes based on current settings), the previous field name is displayed, and can be queried as expected - expected

    2. if the custom field cache has updated, the query builder opens without the custom field name pre-populated (as the previous name is no longer available) - expected

      1. the updated name can be selected in the dropdown and the query can be tested

if the query builder remains open with the old value populated and the cache is updated with the new value, when testing the query the user sees the following error:
note: the query builder isn’t frozen, and the ‘x' and 'cancel’ buttons work as expected. when the query builder is reopened, it follows the experience from 3b above

Done

Details

Assignee

Reporter

Priority

Story Points

Sprint

Development Team

Corsair

Fix versions

Release

Ramsons (R2 2024) Bug Fix

RCA Group

TBD

Affected releases

Quesnelia (R1 2024)

TestRail: Cases

Open TestRail: Cases

TestRail: Runs

Open TestRail: Runs

Created December 6, 2024 at 1:35 PM
Updated January 11, 2025 at 2:44 PM
Resolved January 9, 2025 at 7:09 PM
TestRail: Cases
TestRail: Runs