-
Notifications
You must be signed in to change notification settings - Fork 23
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
update-collection-handling #451
Conversation
@@ -41,6 +41,7 @@ def build_metadata | |||
self.parsed_metadata = {} | |||
add_identifier | |||
add_ingested_metadata | |||
add_collections |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sephirothkod I don't think this is a good choice for bulkrax because this line seems to have been removed intentionally for some reason. however, without it self.collection_ids
is always empty so collections_created?
will return false and throw a CollectionCreatedError. even when the collection is in fact created.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sephirothkod @bkiahstroud actually...I now needed to bring this code into LV and BL through overrides. may it be better to put this code into bulkrax proper, but with a note to reevaluate removing add_collections
from here in the future once the updated logic is worked out?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure lets leave it for now and then I'll have a look when i have time as to how to remove the collections stuff entirely and only reference collections via the new parents code.
parent_field_mapping = self.class.parent_field(parser) | ||
return [] unless parent_field_mapping.present? && record[parent_field_mapping].present? | ||
|
||
identifiers = [] | ||
split_titles = record[collection_field_mapping].split(/\s*[;|]\s*/) | ||
split_titles.each do |c_title| | ||
matching_collection_entries = importerexporter.entries.select { |e| e.raw_metadata['title'] == c_title } | ||
split_references = record[parent_field_mapping].split(/\s*[;|]\s*/) | ||
split_references.each do |c_reference| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
more semantic names.
app/models/bulkrax/csv_entry.rb
Outdated
matching_collection_entries = importerexporter.entries.select { |e| e.raw_metadata['title'] == c_title } | ||
split_references = record[parent_field_mapping].split(/\s*[;|]\s*/) | ||
split_references.each do |c_reference| | ||
matching_collection_entries = importerexporter.entries.select { |e| e.raw_metadata['source_identifier'] == c_reference && e.is_a?(CsvCollectionEntry) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we're no longer using titles to track collections. we also are making sure that we only return collection parents and not work parents so that collections_created?
isn't incorrectly throwing false.
TODO
discuss with braydon
expected behavior