Browse Source

CSV import raises an exception if CSV header has empty columns (#22913, #34326).


git-svn-id: http://svn.redmine.org/redmine/trunk@20576 e93f8b46-1217-0410-a6f0-8f06a7374b81
tags/4.2.0
Go MAEDA 3 years ago
parent
commit
135fd7b79f

+ 1
- 1
app/controllers/imports_controller.rb View File

@@ -173,7 +173,7 @@ class ImportsController < ApplicationController
return if @import.settings['encoding'].blank?

mappings = @import.settings['mapping'] ||= {}
headers = @import.headers.map(&:downcase)
headers = @import.headers.map{|header| header&.downcase}

# Core fields
import_type::AUTO_MAPPABLE_FIELDS.each do |field_nm, label_nm|

+ 2
- 2
test/fixtures/files/import_issues_auto_mapping.csv View File

@@ -1,2 +1,2 @@
priority;Subject;start_date;parent;private;progress;custom;"target version";category;user;estimated_hours;tracker;status;database;cf_6
High;First;2015-07-08;;no;;PostgreSQL;;New category;dlopper;1;bug;new;"PostgreSQL, Oracle";2
priority;Subject;start_date;parent;private;progress;custom;"target version";category;user;estimated_hours;tracker;status;database;cf_6;
High;First;2015-07-08;;no;;PostgreSQL;;New category;dlopper;1;bug;new;"PostgreSQL, Oracle";2;"Column with empty header"

Loading…
Cancel
Save