diff --git a/Koha/BackgroundJob/ImportKBARTFile.pm b/Koha/BackgroundJob/ImportKBARTFile.pm index 890a3c926a..a8793d2499 100644 --- a/Koha/BackgroundJob/ImportKBARTFile.pm +++ b/Koha/BackgroundJob/ImportKBARTFile.pm @@ -235,7 +235,8 @@ sub read_file { sep_char => $delimiter, quote_char => $quote_char, binary => 1, - allow_loose_quotes => 1 + allow_loose_quotes => 1, + formula => 'empty' } ); my $headers_to_check = $csv->getline($fh); diff --git a/Koha/ERM/EUsage/CounterFile.pm b/Koha/ERM/EUsage/CounterFile.pm index 0836455251..5c41a1ea94 100644 --- a/Koha/ERM/EUsage/CounterFile.pm +++ b/Koha/ERM/EUsage/CounterFile.pm @@ -302,7 +302,7 @@ sub validate { my ($self) = @_; open my $fh, "<", \$self->file_content or die; - my $csv = Text::CSV_XS->new( { binary => 1, always_quote => 1, eol => $/, decode_utf8 => 1 } ); + my $csv = Text::CSV_XS->new( { binary => 1, always_quote => 1, eol => $/, decode_utf8 => 1, formula => 'empty' } ); $csv->column_names(qw( header_key header_value )); my @header_rows = $csv->getline_hr_all( $fh, 0, 12 ); @@ -329,7 +329,7 @@ sub _set_report_type_from_file { my ($self) = @_; open my $fh, "<", \$self->file_content or die; - my $csv = Text::CSV_XS->new( { binary => 1, always_quote => 1, eol => $/, decode_utf8 => 1 } ); + my $csv = Text::CSV_XS->new( { binary => 1, always_quote => 1, eol => $/, decode_utf8 => 1, formula => 'empty' } ); $csv->column_names(qw( header_key header_value )); my @header_rows = $csv->getline_hr_all( $fh, 0, 12 ); @@ -352,7 +352,7 @@ sub _get_rows_from_COUNTER_file { my ($self) = @_; open my $fh, "<", \$self->file_content or die; - my $csv = Text::CSV_XS->new( { binary => 1, always_quote => 1, eol => $/, decode_utf8 => 1 } ); + my $csv = Text::CSV_XS->new( { binary => 1, always_quote => 1, eol => $/, decode_utf8 => 1, formula => 'empty' } ); my $header_columns = $csv->getline_all( $fh, 13, 1 ); $csv->column_names( @{$header_columns}[0] ); diff --git a/Koha/Patrons/Import.pm b/Koha/Patrons/Import.pm index f4b5c2538e..c1543ec46c 100644 --- a/Koha/Patrons/Import.pm +++ b/Koha/Patrons/Import.pm @@ -61,7 +61,7 @@ has 'today_iso' => ( is => 'ro', lazy => 1, default => sub { output_pref( { dt => dt_from_string(), dateonly => 1, dateformat => 'iso' } ); }, ); has 'text_csv' => ( is => 'rw', lazy => 1, - default => sub { Text::CSV->new( { binary => 1, } ); }, ); + default => sub { Text::CSV->new( { binary => 1, formula => 'empty' } ); }, ); sub import_patrons { my ($self, $params) = @_;