Closed ojlyytinen closed 5 years ago
This is related to https://github.com/projecthydra-labs/activefedora-aggregation/issues/72 somewhat.
A possible hint. (I'm not sure if my bug is the same problem as this issue)
In heliotrope (a curation_concerns based Rails app), when I delete the representative FileSet from a GenericWork, there is a callback that is supposed to remove the representative relationship from the parent GenericWork.
It does that by looping through all the parent works and updating them, but I've noticed that when I delete the FileSet, it never enters the loop because the list of parent works is (incorrectly) empty: https://github.com/projecthydra-labs/curation_concerns/blob/master/curation_concerns-models/app/models/concerns/curation_concerns/file_set/belongs_to_works.rb#L40
It's using the hydra-pcdm in_objects method to find the list of parent works: https://github.com/projecthydra-labs/curation_concerns/blob/master/curation_concerns-models/app/models/concerns/curation_concerns/file_set/belongs_to_works.rb#L11
https://github.com/mlibrary/heliotrope/issues/116#issuecomment-218491025 seems to confirm that this was fixed, and https://github.com/samvera-deprecated/activefedora-aggregation/issues/72 seems to have been resolved with updates to CurationConcerns (https://github.com/pulibrary/plum/issues/249)
If I destroy an object that's in ordered_members of another, then that seems to break the parent object. I'm using v0.3.1.