Skip to content
Snippets Groups Projects
Commit 03e9f4c8 authored by Anusha Ranganathan's avatar Anusha Ranganathan
Browse files

Merge branch 'bug_fix/fileset_title_uniqueness_issue' into 'develop'

Fixed file_set title uniqueness issue

Closes FDM/rdm-system/antleaf-projectmanagement#358

See merge request !279
parents 7c787fc8 07368f33
Branches
Tags
1 merge request!279Fixed file_set title uniqueness issue
Pipeline #13308 failed
......@@ -73,14 +73,14 @@ module Hyrax
# actual characterization service
def set_characterization_data(s3_file_url, file_set)
path = URI.parse(Addressable::URI.unencode(s3_file_url)).path
file_name = path.split('/')[-1]
file_name = path.split('/')[-1].downcase
uploaded_file_id = path.split('/')[-2]
uploaded_file = Hyrax::UploadedFile.find(uploaded_file_id)
parent_object = file_set.parent_object
siblings = parent_object.file_sets
duplicate_record = siblings.select {|fs| fs.title[0] == file_name && fs.id != file_set.id }
duplicate_record = siblings.select {|fs| fs.title[0].downcase == file_name && fs.id != file_set.id }
new_title = nil
if duplicate_record.present?
......@@ -190,7 +190,7 @@ module Hyrax
end
def genrate_file_set_title(siblings, file_name)
existing_titles = siblings.map{ |fs| fs.title[0] }
existing_titles = siblings.map{ |fs| fs.title[0].downcase }
base_name, extension = File.basename(file_name, ".*"), File.extname(file_name)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment