Don't crash on non-traditional external field formats#7179
Conversation
Triggered by 7d20fa6 on branch refs/heads/issue-7144
emenslin
left a comment
There was a problem hiding this comment.
- The Carry Forward range input should appear
- Make sure you can only enter a valid start catalog number (It should use the catalog num of the CO you just saved)
- Make sure you can only enter a valid end catalog number
- Make sure you can't enter invalid ranges (where the start is bigger than the end for example)
- Make sure you can't enter a range with 500 or more records.
- Click Carry Forward and make sure all the COs in the range you specified were created
- Click Carry Forward and see a dialog with a list of all existing catalog numbers.
- Try Bulk Carry Forward and make sure no record set is created. But make sure all newly created records appear on the form page thing.
- Try creating a CO with a Collection Object Type with that uses a different formatter for the catalog number. Bulk Carry should still work, except if the formatter does not support autoincrementing (the button will be disabled).
-
Ensure that the CollectionObject form can be opened
-
Ensure the series-entry,
Bulk Carry Forwardrange box does not appear on the form and you can not use the BulkCarryForward range feature -
Enable the
Show Bulk Carry Forward countpreference in the CollectionObject's Form Meta menu -
Ensure the
Bulk Carry Forwardcount number input does not appear on the form and you can not use the BulkCarryForward count feature -
Please also do some general testing regarding Carry Forward and the BulkCarryForward configuration options!
- Particularly, can cloning COGs be tested? As well as CollectionObjects in COGs. Ensure there are no regressions!
- When I first loaded up an instance both count and range were selected but when I deselected one it fixed itself so I am not sure what happened. Might not be a problem since I can't recreate it but I wanted to mention it here just in case.
- In main on COGs the checkboxes for showing
cloneandcarry forwardon the form are all there but checking them doesn't do anything whereas on this branch the checks are just not visible. Was this intentional? Also if it was, the checkbox for showing the 'Add' button needs to be visible as that one should be configurable, I think hiding the checkboxes for showingcloneandcarry forwardmakes sense since they don't work for COGs anyway.
Triggered by 53e062f on branch refs/heads/issue-7144
alesan99
left a comment
There was a problem hiding this comment.
- The Carry Forward range input should appear
- Make sure you can only enter a valid start catalog number (It should use the catalog num of the CO you just saved)
- Make sure you can only enter a valid end catalog number
- Make sure you can't enter invalid ranges (where the start is bigger than the end for example)
- Make sure you can't enter a range with 500 or more records.
- Click Carry Forward and make sure all the COs in the range you specified were created
- Click Carry Forward and see a dialog with a list of all existing catalog numbers.
- Try Bulk Carry Forward and make sure no record set is created. But make sure all newly created records appear on the form page thing.
- Try creating a CO with a Collection Object Type with that uses a different formatter for the catalog number. Bulk Carry should still work, except if the formatter does not support autoincrementing (the button will be disabled).
- Ensure that the CollectionObject form can be opened
- Enable the
Show Bulk Carry Forward rangepreference in the CollectionObject's Form Meta menu - Ensure the series-entry,
Bulk Carry Forwardrange box does not appear on the form and you can not use the BulkCarryForward range feature - Enable the
Show Bulk Carry Forward countpreference in the CollectionObject's Form Meta menu - Ensure the
Bulk Carry Forwardcount number input does not appear on the form and you can not use the BulkCarryForward count feature - Please also do some general testing regarding Carry Forward and the BulkCarryForward configuration options!
Using CatalogNumberString as the collection default no longer crashes, as well as using it as the COT formatter.
Tried cloning COs within a COG, looks like its working correctly except isPrimary misassigned, but that is not a regression 👍
The Add button also appears on COG forms now as expected.

And the issue I was having with existing catalog numbers causing a crash has been fixed 👍👍
emenslin
left a comment
There was a problem hiding this comment.
- The Carry Forward range input should appear
- Make sure you can only enter a valid start catalog number (It should use the catalog num of the CO you just saved)
- Make sure you can only enter a valid end catalog number
- Make sure you can't enter invalid ranges (where the start is bigger than the end for example)
- Make sure you can't enter a range with 500 or more records.
- Click Carry Forward and make sure all the COs in the range you specified were created
- Click Carry Forward and see a dialog with a list of all existing catalog numbers.
- Try Bulk Carry Forward and make sure no record set is created. But make sure all newly created records appear on the form page thing.
- Try creating a CO with a Collection Object Type with that uses a different formatter for the catalog number. Bulk Carry should still work, except if the formatter does not support autoincrementing (the button will be disabled).
- Ensure that the CollectionObject form can be opened
- Enable the
Show Bulk Carry Forward rangepreference in the CollectionObject's Form Meta menu - Ensure the series-entry,
Bulk Carry Forwardrange box does not appear on the form and you can not use the BulkCarryForward range feature - Enable the
Show Bulk Carry Forward countpreference in the CollectionObject's Form Meta menu - Ensure the
Bulk Carry Forwardcount number input does not appear on the form and you can not use the BulkCarryForward count feature - Please also do some general testing regarding Carry Forward and the BulkCarryForward configuration options!
Looks good, only thing I discovered is I can't bulk carry forward on a CO with a non default COT with a different catalog number format.
07-23_15.52.mp4
Specify 7 Crash Report - 2025-07-23T20_52_22.360Z.txt
Link to the db: https://ojsmnh20250717-issue-7144.test.specifysystems.org/specify/
@emenslin I managed to recreate it on your instance a couple times, then it looks like it fixed itself? Very strange. Update: |
|
I believe I have discovered the problem. It seems to have to do with having no fields selected in the configuration for bulk carry forward. I'm not sure why this is because you cannot deselect 'type' in the config so there is probably some other field in there that is causing the problem but I am not sure which 07-24_10.11.mp4Wrote up #7197 |
Disable Series Data Entry when 'isCurrent' and 'isPrimary' can be misassigned
Triggered by 1c9d603 on branch refs/heads/issue-7144
@emenslin It appears deselect all is deselecting required fields, even though they still appear checked. So the issue probably happens with 1. a non default formatter 2. Some invalid records (maybe) 3. the user click deselct all in the settings. This is an existing issue that affects Bulk Carry Forward Count, though it should be written up. |
emenslin
left a comment
There was a problem hiding this comment.
-
The Carry Forward range input should appear
-
Make sure you can only enter a valid start catalog number (It should use the catalog num of the CO you just saved)
-
Make sure you can only enter a valid end catalog number
-
Make sure you can't enter invalid ranges (where the start is bigger than the end for example)
-
Make sure you can't enter a range with 500 or more records.
-
Click Carry Forward and make sure all the COs in the range you specified were created
-
Click Carry Forward and see a dialog with a list of all existing catalog numbers.
-
Try Bulk Carry Forward and make sure no record set is created. But make sure all newly created records appear on the form page thing.
-
Try creating a CO with a Collection Object Type with that uses a different formatter for the catalog number. Bulk Carry should still work, except if the formatter does not support autoincrementing (the button will be disabled).
-
Ensure that the CollectionObject form can be opened
-
Ensure the series-entry,
Bulk Carry Forwardrange box does not appear on the form and you can not use the BulkCarryForward range feature -
Enable the
Show Bulk Carry Forward countpreference in the CollectionObject's Form Meta menu -
Ensure the
Bulk Carry Forwardcount number input does not appear on the form and you can not use the BulkCarryForward count feature -
Please also do some general testing regarding Carry Forward and the BulkCarryForward configuration options!
- Particularly, can cloning COGs be tested? As well as CollectionObjects in COGs. Ensure there are no regressions!
Looks good, I didn't run into any new issues.
Don't crash on non-traditional external field formats



Fixes #7144
As alluded to by @alesan99 in #7144 (comment), the primary underlying cause of #7144 was a change in #6710 for handling the case where a Field Formatter for
CollectionObject -> catalogNumberdid not exist.This was mainly caused in the following line where a non-null assertion operator (!) was used to tell the TypeScript compiler that the value couldn't be null (even when it could be null).
This would largely be the case when the CollectionObject catalogNumber format was defined as an external format and was not the known
CatalogNumberNumericformatspecify7/specifyweb/frontend/js_src/lib/components/FieldFormatters/index.ts
Lines 31 to 37 in f5179b4
In the default field formatters, this would be the case for the
CatalogNumberStringformatspecify7/config/backstop/uiformatters.xml
Lines 53 to 55 in f5179b4
This PR handles the case where a
CollectionObject -> catalogNumberis not defined, as well as does some refactoring/maintenance work to extract the BulkCarry logic to its own components.Checklist
self-explanatory (or properly documented)
Testing instructions
Test series entry (instructions take from #6710 (comment))
CollectionObject -> catalogNumberField Format which includes anexternaltag with any value besidesedu.ku.brc.specify.ui.CatalogNumberUIFieldFormatter.CatalogNumberStringformat:specify7/config/backstop/uiformatters.xml
Lines 53 to 55 in f5179b4
Ensure that the CollectionObject form can be opened
Enable the
Show Bulk Carry Forward rangepreference in the CollectionObject's Form Meta menuEnsure the series-entry,
Bulk Carry Forwardrange box does not appear on the form and you can not use the BulkCarryForward range featureEnable the
Show Bulk Carry Forward countpreference in the CollectionObject's Form Meta menuEnsure the
Bulk Carry Forwardcount number input does not appear on the form and you can not use the BulkCarryForward count featurePlease also do some general testing regarding Carry Forward and the BulkCarryForward configuration options!