SAEON / odp-server

Source code for the SAEON Open Data Platform server components.
GNU Affero General Public License v3.0
0 stars 2 forks source link

Circular parent record references should be disallowed #24

Open marksparkza opened 6 months ago

marksparkza commented 6 months ago

A recursion error occurred when saving a record whose parent record was also its child. These two records were migrated from ODP v1 with this invalid relationship.

The records (or at least one of them) will need to be fixed manually in the DB. We also need to check all records to make sure there are no more such circular references.

The record API should be revisited to make sure it blocks any record create/update that would introduce such a circular reference - currently it looks like it only checks that the immediate parent is not a child.

marksparkza commented 6 months ago

I've updated those two records (10.15493/DEA.MIMS.26052100 and 10.15493/DEA.MIMS.26052101) in the DB - set parent_id to null. Then removed the IsPartOf relatedIdentifier in the metadata of each via ODP Admin.