SpeciesFileGroup / taxonworks

Workbench for biodiversity informatics.
http://taxonworks.org
MIT License
87 stars 27 forks source link

[Bug]: CSD: adding type material results in duplicates/error #4002

Closed AntWeb-org closed 3 months ago

AntWeb-org commented 3 months ago

Steps to reproduce the bug

1. Entering a CSD that is a type
2. Select the Taxon name under Type Material section from the dropdown menu
3. Select Type (paratype in this case)
4. Click Add and see non-link Type Material entry (screenshot 1)
If I save at this point I get two Type Material entries (screenshot 2)
When I click Save or Save and New after entering additional CO data I get an error message (screenshot 3)
I either have to refresh to remove the non-link Type Material entry or delete it. Then I can Save or Save and New.
...

Screenshot

Screenshot 1 image

Screenshot 2 image

Screenshot 3 image

Expected behavior

When I add the type material taxon name and type, I should get only the linked type material entry and be able to move on to Save or Save and New without having to refresh or delete a duplicate type material entry.

Additional Screenshots

No response

Environment

Production

Sandbox Used

No response

Version

v0.43.1

Browser Used

Chrome Version 126.0.6478.185

jlpereira commented 3 months ago

Hello there!

You can't create duplicates types for the same CO, if you want to modify the one already created, you have to click on edit button. I pushed a change to remove types already used from the list

AntWeb-org commented 3 months ago

I do not want to create duplicates. One is added when I click Add but another is created when I try to save or save and new (see screenshot 2). I have to either delete one or refresh to remove one. I do not know why there are two lines of type material but I am not trying to add two.

jlpereira commented 3 months ago

Aha! Replicated, I couldn't replicate this because I was pressing Save, Save and new has to be clicked at least one time.

The issue was related to how the data was reset to initial state in the store after press New. You will see this change in the new release. In the meantime, you will have to delete the "non-link" items when they duplicate, or refresh the page

AntWeb-org commented 3 months ago

Glad you could replicate it - I wasn't sure it was doable. It happened to me after Adding and Saving and then I'd get the error trying to Save or Save and New. Ok. thanks for your help!