Closed laritakr closed 6 years ago
A slight adjustment to the available children:
This means that assuming existing paths A-B-D and A-C, it is ok to create A-D and A-C-D.
A
/ \
B C
|
D
can become...
A
/ | \
B C D
| |
D D
Ancestors: parse all collection ids in current collection's nesting_collection__pathnames_ssim
removing dups and removing current collection's id
All Descendants of qv33rw64w: matches for solr query nesting_collection__pathnames_ssim:*qv33rw64w/*
NOTE: ending with /*
prevents it from matching the current collection which is the last part of the pathname
Immediate Descendents of qv33rw64w: matches for solr query nesting_collection__parent_ids_ssim:qv33rw64w
Fixed by #2574
Descriptive summary
( Collections Sprint)
The list of available child collections and available parent collections should not include any collections currently in ANY relationship (either parent or child) with the collection being modified.
The nesting query service needs to take into account the full ancestral path. It should match the logic used in the nesting indexer.
Rationale
Adding these as a parent or child should cause a PCDM error, and does cause circular indexing errors. We need to keep them from the list of options to select.
Nesting decisions should be made in
/app/services/hyrax/collections/nested_collection_query_service.rb
. Additional validations (if specific to one particular case), could occur in the form/app/forms/hyrax/forms/dashboard/nest_collection_form.rb
, but in general, we want the query service provide a fully valid list of collections for nesting.Details
Given a collection, available parent collections should include only:
Given a collection, available subcollections should include only:
Solr fields for nesting collections are:
Related Issues
Pull Request: Populate edit Relationships tab #1719 Manage Collection Relationships Tab #2257 Refactor the nested collection modal queries to use the form #2294 Wire up nested collection delete buttons #2295