specify / specify7

Specify 7
https://www.specifysoftware.org/products/specify-7/
GNU General Public License v2.0
66 stars 36 forks source link

Items in a pick list with commas cannot be selected when using the 'IN' operator in queries #5208

Open grantfitzsimmons opened 3 months ago

grantfitzsimmons commented 3 months ago

Describe the bug Items in a pick list with commas cannot be selected when using the 'IN' operator in queries.

To Reproduce Steps to reproduce the behavior:

  1. Query a field that has pick list items with a comma in the value
  2. Use the 'IN' operator on that field
  3. Try to select those items
  4. See error

Expected behavior Pick list items with commas in the value should still be selectable in queries.

Screenshots

https://lsam20240808-v7962.test.specifysystems.org/specify/query/127/

https://github.com/user-attachments/assets/36e5e015-934e-4a39-8639-8b6b6ea3c670

Crash Report Arc, macOS v7.9.6.2, spadmin on lsam_2024_08_08 on the test panel

Specify 7 System Information - 2024-08-08T13_47_39.934Z.txt

Reported By: Discovered when testing deduplicated pick list items on the lsam database.

CarolineDenis commented 1 month ago

NOTES:

See https://github.com/specify/specify7/blob/f58f0d43c4441ee1718ab92823f9a1da3d98bed2/specifyweb/frontend/js_src/lib/components/QueryBuilder/FieldFilter.tsx#L186

@grantfitzsimmons In which cases is the elected value a list?