Open lexiclevenger opened 2 months ago
Can recreate in edge (7.9.6.2)
This is because the backend does not use the schema configuration for CollectionObject -> catalogNumber to format the field.
Instead, it uses the Collection -> catalogNumFormatName
and then references that formatter in the UIFormatters file.
This is a convention that Specify 6 uses which Specify 7 has to maintain for compatibility.
Thus the only way to actually change the format of CollectionObject -> catalogNumber
in Specify 7, you have to:
Collection -> catalogNumFormatName
to be the name of the formatter you wish to use for the fieldThere are instructions on how to accomplish this in Specify 6 (the instructions include modifying the Collection via SQL).
https://discourse.specifysoftware.org/t/to-change-a-catalog-number-format-other-than-default/283
The process/workflow leaves much to be desired however, and can be vastly improved.
I think a much better solution (assuming we still need to maintain compatibility with Specify 6) would be to implicitly update the Collection -> catalogNumFormatName
whenever a new format is set for CollectionObject -> catalogNumber
in the Schema Configuration.
Most users are probably expecting the process of changing CollectionObject -> catalogNumber format to be the same as any other field in Specify, but it is not.
@melton-jason The format name "CatalogNumberHerpetos" is already the value for catalogNumFormatName in the Collection table. Normally, I can successfully change the value by adding the catalogNumFormatName field to the Collection form and inputting the name of the desired field format. In this case, the format named "CatalogNumber" is still being enforced. Once the format "CatalogNumber" is removed, the format "CatalogNumberHerpetos" functions as it should.
I saw the same when I was working with @lexiclevenger and it left me perplexed
Describe the bug On this database, the configured catalogNumber format 'CatalogNumberHerpetos' is displayed in the catalogNumber field. However, when a CO record is saved with that field format, an error is thrown because it does not match the format 'CatalogNumber.' The 'CatalogNumberHerpetos' format is saved in both the schema and in the Collection table, so the other format should not be used. The only solution for this is to comment out the 'CatalogNumber' format in the UI Formatters xml.
To Reproduce Steps to reproduce the behavior:
Expected behavior The "CatalogNumberHerpetos" format should be respected instead of "CatalogNumber."
Screenshots
https://github.com/specify/specify7/assets/164079735/3c5e27c1-9822-4d2b-8a9f-c35a830f527c
Crash Report
Specify 7 Crash Report - 2024-06-28T20_36_45.131Z.txt
Please, also fill out the following information manually:
UI Formatters file: