Open bronwyncombs opened 12 months ago
For developer future reference, this is most likely happening because of the useParser()
hook in */lib/components/Interactions/InteractionDialog.tsx
More specifically because it fetches the value of every value
attribute in a formatter and checks whether the delimiter is included.
Thus when the useCommaAsDelimiter
preference is set to auto
, this specific regular expression will never use comma as a delimiter because Specify thinks that the formatter itself has a comma.
If CSIRO wishes to have the useCommaAsDelimiter
preference set to 'auto' before this bug is fixed, they can replace the value
attribute of the CatalogNumberAnwcTissues
formatter in their UIFormatters to an equivalent regular expression which does not use commas.
I have found, tested, and thus verified through Data Entry, QueryBuilder, and Workbench, one such equivalent regular expression which does not utilize commas.
(G[0-9]?[0-9]?[0-9]?[0-9]?[0-9])
@melton-jason, can this be closed?
As far as I know, the actual bug has not been fixed.
In brief (explained further in https://github.com/specify/specify7/issues/4122#issuecomment-1765376026), the problem was that when useCommaAsDelimiter
was set to auto, Specify would never use a comma as delimeter if the UIFormatter for the field contained a comma in it's value
.
This is well intentioned, but was not taking into account regular expression formatters: whose value
is the regular expression itself and thus may commonly contain commas even though the actual expected value of the field may not.
From CSIRO:
To Reproduce This is how the catalog number format is defined:
The comma in
(G[0-9]{1,5})
prevents it from accepting a comma when the preference is set to automatically detect delimiters.