From 7d7f02a36fd6d636c6b67b8d23ed118bf3ca6773 Mon Sep 17 00:00:00 2001 From: Magnus Enger Date: Fri, 16 Aug 2024 14:59:20 +0200 Subject: [PATCH] Bug 33339: (Follow up) Fix more cases of formula=empty This patch adds formula=empty to: - Koha::ERM::EUsage::SushiCounter::_build_COUNTER_report_file() It also removes formula=empty from: - C4::ImportExportFramework::_import_table_csv() - Koha::Patrons::Import::generate_patron_attributes() because in these places CSV is only read, not generated. Please FQA if this is unwanted. Signed-off-by: Chris Cormack --- C4/ImportExportFramework.pm | 2 +- Koha/ERM/EUsage/SushiCounter.pm | 2 +- Koha/Patrons/Import.pm | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/C4/ImportExportFramework.pm b/C4/ImportExportFramework.pm index d02ec43d574..2f9739d8a36 100644 --- a/C4/ImportExportFramework.pm +++ b/C4/ImportExportFramework.pm @@ -965,7 +965,7 @@ sub _import_table_csv shift @fieldsPK; my $ok = 0; my $pos = 0; - my $csv = Text::CSV_XS->new( { binary => 1, formula => "empty" } ); + my $csv = Text::CSV_XS->new( { binary => 1 } ); while ( my $row = $csv->getline($dom) ) { my @fields = @$row; @arrData = @fields; diff --git a/Koha/ERM/EUsage/SushiCounter.pm b/Koha/ERM/EUsage/SushiCounter.pm index 4e33f8988f5..10bde4ea210 100644 --- a/Koha/ERM/EUsage/SushiCounter.pm +++ b/Koha/ERM/EUsage/SushiCounter.pm @@ -86,7 +86,7 @@ sub _build_COUNTER_report_file { my @report = ( @{$header}, @{$column_headings}, @{$body} ); #TODO: change this to tab instead of comma - csv( in => \@report, out => \my $counter_file, encoding => "utf-8" ); + csv( in => \@report, out => \my $counter_file, encoding => "utf-8", formula => 'empty' ); return $counter_file; diff --git a/Koha/Patrons/Import.pm b/Koha/Patrons/Import.pm index f4b5c2538e7..ce4ae0eb53d 100644 --- a/Koha/Patrons/Import.pm +++ b/Koha/Patrons/Import.pm @@ -627,7 +627,7 @@ sub generate_patron_attributes { push (@$feedback, { feedback => 1, name => 'attribute string', value => $string }); return [] unless $string; # Unit tests want the feedback, is it really needed? - my $csv = Text::CSV->new( { binary => 1, formula => "empty" } ); # binary needed for non-ASCII Unicode + my $csv = Text::CSV->new( { binary => 1 } ); # binary needed for non-ASCII Unicode my $ok = $csv->parse($string); # parse field again to get subfields! my @list = $csv->fields(); my @patron_attributes = -- 2.39.2