Skip to content
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

BusinessRuleException when deleting and re-adding a collector with the same agent #2980

Closed
Tracked by #2924
grantfitzsimmons opened this issue Feb 13, 2023 · 3 comments
Assignees
Labels
1 - Bug Incorrect behavior of the product 2 - Forms Issues that are related to the form system

Comments

@grantfitzsimmons
Copy link
Member

grantfitzsimmons commented Feb 13, 2023

BusinessRuleException at /api/specify/collectingevent/6/
('Collector must have unique agent in collectingevent', {'table': 'Collector', 'localizationKey': 'childFieldNotUnique', 'fieldName': 'agent', 'fieldData': ('agent', {'id': 626, 'abbreviation': None, 'agenttype': 1, 'date1': None, 'date1precision': None, 'date2': None, 'date2precision': None, 'dateofbirth': None, 'dateofbirthprecision': 1, 'dateofdeath': None, 'dateofdeathprecision': 1, 'datetype': None, 'email': None, 'firstname': 'Donald', 'guid': 'e0b196c7-f3af-4e3e-a5ef-5e8f8bf664ae', 'initials': None, 'integer1': None, 'integer2': None, 'interests': None, 'jobtitle': None, 'lastname': 'Huggins', 'middleinitial': 'E', 'remarks': None, 'suffix': None, 'text1': None, 'text2': None, 'text3': None, 'text4': None, 'text5': None, 'title': 'mr', 'url': None, 'verbatimdate1': None, 'verbatimdate2': None, 'version': 1, 'collcontentcontact': None, 'colltechcontact': None, 'createdbyagent': 1986, 'division': 2, 'instcontentcontact': None, 'insttechcontact': None, 'modifiedbyagent': 1987, 'organization': None, 'specifyuser': None}), 'parentField': 'collectingevent', 'parentData': 'collectingevent: id=6', 'conflicting': [2500]})

Specify 7 Crash Report - 2023-02-13T14 53 10.570Z.txt


This is a spin-off of #2884 focused on the underlying issue

I was editing the collectors in a record.

They were in the wrong order, so I deleted, them, and put them back, when I hit save, I got this error. Maybe I should have saved after I deleted???

Reported by: Heather Cole at AAFC

@maxpatiiuk
Copy link
Member

Possibly related to #1702

@grantfitzsimmons grantfitzsimmons moved this to 📋 Backlog in Back-End Backlog Mar 9, 2023
@melton-jason melton-jason moved this from 📋 Backlog to 🏗 In progress in Back-End Backlog Mar 14, 2023
@melton-jason
Copy link
Contributor

This is caused by the same bug which caused #1702.

This occurs for every -to-many relationship and is related to the way the frontend checks uniqueness rules. Essentially, when there is a -to-many relationship, the frontend would only check records within that -to-many relationship. Thus the database contains the values, but the frontend simply thinks it is a new AccessionAgent, and is only checking other AccessionAgents in that Acession.

So this specific case was not accounted for.

From #1702 (comment)

@github-project-automation github-project-automation bot moved this to 📋 Backlog in Front-End Backlog Mar 14, 2023
@melton-jason melton-jason moved this from 📋 Backlog to 🏗 In progress in Front-End Backlog Mar 14, 2023
@grantfitzsimmons grantfitzsimmons added 2 - Forms Issues that are related to the form system and removed Unsorted labels Jul 2, 2023
@emenslin
Copy link
Collaborator

Duplicate of #1702

@emenslin emenslin marked this as a duplicate of #1702 May 31, 2024
@emenslin emenslin closed this as not planned Won't fix, can't repro, duplicate, stale May 31, 2024
@github-project-automation github-project-automation bot moved this from 🏗 In progress to ✅ Done in Front-End Backlog May 31, 2024
@github-project-automation github-project-automation bot moved this to Shipped in Forms Aug 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1 - Bug Incorrect behavior of the product 2 - Forms Issues that are related to the form system
Projects
Status: Shipped
Status: Done
Development

No branches or pull requests

4 participants