diff --git a/app/models/concerns/bulkrax/export_behavior.rb b/app/models/concerns/bulkrax/export_behavior.rb index 14fbfc6d..4cfa8513 100644 --- a/app/models/concerns/bulkrax/export_behavior.rb +++ b/app/models/concerns/bulkrax/export_behavior.rb @@ -26,6 +26,7 @@ def hyrax_record # Prepend the file_set id to ensure a unique filename and also one that is not longer than 255 characters def filename(file_set) + # NOTE: Will this work with Valkyrie? return if file_set.original_file.blank? fn = file_set.original_file.file_name.first mime = ::Marcel::MimeType.for(file_set.original_file.mime_type) diff --git a/app/parsers/bulkrax/csv_parser.rb b/app/parsers/bulkrax/csv_parser.rb index e885ff79..03159ebb 100644 --- a/app/parsers/bulkrax/csv_parser.rb +++ b/app/parsers/bulkrax/csv_parser.rb @@ -231,6 +231,7 @@ def write_files CSV.open(setup_export_file(folder_count), "w", headers: export_headers, write_headers: true) do |csv| group.each do |entry| csv << entry.parsed_metadata + # TODO: This is precarious when we have descendents of Bulkrax::CsvCollectionEntry next if importerexporter.metadata_only? || entry.type == 'Bulkrax::CsvCollectionEntry' store_files(entry.identifier, folder_count.to_s) @@ -292,6 +293,9 @@ def object_names def sort_entries(entries) # always export models in the same order: work, collection, file set + # + # TODO: This is a problem in that only these classes are compared. Instead + # We should add a comparison operator to the classes. entries.sort_by do |entry| case entry.type when 'Bulkrax::CsvCollectionEntry' diff --git a/app/services/bulkrax/remove_relationships_for_importer.rb b/app/services/bulkrax/remove_relationships_for_importer.rb index 65a9371b..1195b505 100644 --- a/app/services/bulkrax/remove_relationships_for_importer.rb +++ b/app/services/bulkrax/remove_relationships_for_importer.rb @@ -78,12 +78,14 @@ def remove_relationships_from_collection(collection) return if defined?(Hyrax) + # NOTE: This should not need to be migrated to the object factory. # Remove parent collection relationships collection.member_of_collections.each do |parent_col| Hyrax::Collections::NestedCollectionPersistenceService .remove_nested_relationship_for(parent: parent_col, child: collection) end + # NOTE: This should not need to be migrated to the object factory. # Remove child collection relationships collection.member_collections.each do |child_col| Hyrax::Collections::NestedCollectionPersistenceService