-
Notifications
You must be signed in to change notification settings - Fork 41
Allow catalogNumber format to be determined by CollectionObjectType #5431
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
ONLY affects autonumbering. QB and WB still use Collection -> catalogNumFormatName
alesan99
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Testing instructions
- Define a Field Format for
Collection Object -> catalogNumberwhich is different than the currentCollection -> Catalog Num Format Name- An example field format called
Rocksis provided below:
- An example field format called
- Go to the Data Entry form to create a new Collection Object Type
- Ensure the Catalog Number Format Name picklist shows all Catalog Number Field Formats
- Save the Collection Object Type with a Catalog Number Format Name that is different than the Collection -> catalogNumFormatName
- Make sure
collectionObjectTypeis on the Collection Object form - Go to the Data Entry form to create a new Collection Object
- Change the Collection Object Type of the Collection Object to be that which you previously saved
- Ensure the Catalog Number of the Collection Object is replaced with the pattern of the new
- (If needed) Modify the Catalog Number so that it matches the format of formatter
- Save the Collection Object with the new format
Functionality wise it seems to be working 👍👍
On the CO form it looks like the form needs an extra update in order to be okay with the new format.
Clicking the save button twice does the trick, or typing in the new catalog number manually.
chrome_9hLjzWdtpV.mp4
The issue also persists if you switch to a different CO of a different type in the same tab.
|
@alesan99
That is good for this pr 👍 |
bronwyncombs
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Define a Field Format for
Collection Object -> catalogNumberwhich is different than the currentCollection -> Catalog Num Format Name- An example field format called
Rocksis provided below:
- An example field format called
- Go to the Data Entry form to create a new Collection Object Type
- Ensure the Catalog Number Format Name picklist shows all Catalog Number Field Formats
- Save the Collection Object Type with a Catalog Number Format Name that is different than the Collection -> catalogNumFormatName
- Make sure
collectionObjectTypeis on the Collection Object form - Go to the Data Entry form to create a new Collection Object
- Change the Collection Object Type of the Collection Object to be that which you previously saved
- ** Ensure the Catalog Number of the Collection Object is replaced with the pattern of the new
- (If needed) Modify the Catalog Number so that it matches the format of formatter
- Save the Collection Object with the new format
Catalog Number Format Name list appears correctly on COT form and in schema config. COT pick list on CO also displays correctly. Format switch in field functions normally other than needing to click elsewhere on the form to dismiss initial save block.
** I noticed that the CO form header, that displays the catalog number format before a catalog number is saved to the form, does not reflect the format chosen with the COT picklist. If there are two COTs available, this header is consistently opposite of the one on the form.
Screen.Recording.2024-12-05.at.12.52.05.PM.mov
combs-a
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Testing instructions
- Define a Field Format for
Collection Object -> catalogNumberwhich is different than the currentCollection -> Catalog Num Format Name- An example field format called
Rocksis provided below:
- An example field format called
- Go to the Data Entry form to create a new Collection Object Type
- Ensure the Catalog Number Format Name picklist shows all Catalog Number Field Formats
- Save the Collection Object Type with a Catalog Number Format Name that is different than the Collection -> catalogNumFormatName
- Make sure
collectionObjectTypeis on the Collection Object form - Go to the Data Entry form to create a new Collection Object
- Change the Collection Object Type of the Collection Object to be that which you previously saved
- Ensure the Catalog Number of the Collection Object is replaced with the pattern of the new
- (If needed) Modify the Catalog Number so that it matches the format of formatter
- Save the Collection Object with the new format
Had a brief strange thing happen where it wasn't switching the format, but seems to have fixed itself on a reload (without clearing cache) so probably okay. Same thing as Alejandro where there's a save blocker incorrectly placed, but clicking anywhere on the form and not just the save blocker clears it.
I didn't run into Bronwyn's second issue, but I did see the same thing with the header. I do remember there being issues with the header update being a bit slow so maybe it's something like that. Will this be addressed in this PR?
Good work Jason! Everything looks good besides the small header thing. 🎉
No it will not addressed in this pr if present in prod. Could you create an issue for it? |
|
There may be some other bugs at play here, but at least there is an Issue already about the header being 'slow' to update: #3579. The save blocker you briefly see after changing the CollectionObjectType is because everything is happening in the order:
We need to conceptually swap steps 3 and 4, but I have not thought of an easy way to accomplish this in the code. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
~~See above comments for approval reason; header lag is the separate issue that Jason linked 👍 ~~
Misread something along the way and thought that the save blocker bit was about the header lag, so I dismissed my review just in case we're going to address that save blocker issue here. If not, then I'll approve it. 🫡
Misread comments, need to wait on dev comment to fully approve since it is an issue with the PR

Fixes #5232, #5233
See #5234
Aside from implementing #5232 and #5233, there are some other improvements in this PR!
Schema Config
fieldName=fieldname) above the restMigrations
There were some bugs in other migrations which used the functions defined in specifyweb/specify/update_schema_config.py. These bugs have been fixed in this PR, and a migration has been written to fix these bugs for databases already affected: specify/0017_schemaconfig_fixes.py
UIFormatter picklists for Collection -> catalogNumFormatName and CollectionObjectType -> catalogNumberFormatName
CO -> catalogNumberField Formatters*on the DataEntry Form, they will only appear as a PickList if
uitype="combobox"is used on the form definitionChecklist
and self-explanatory (or properly documented)
Testing instructions
Collection Object -> catalogNumberwhich is different than the currentCollection -> Catalog Num Format NameRocksis provided below:collectionObjectTypeis on the Collection Object form