From 3323882bcb455470c782e89b2597499dcd23d738 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Tue, 8 Nov 2016 17:26:36 +0000 Subject: [PATCH] Bug 17590 - Exporting reports as CSV with 'delimiter' SysPref set to 'tabulation' creates files with 't' as separator To test: Set 'delimiter' system preference to 'tabs' Export a report as csv Open the file in text editor and note fields separated by character 't' Apply patch Export report as CSV Open file in text editor and note tabs are used to separate fields Signed-off-by: Bernardo Gonzalez Kriegel tabs now, no errors. Signed-off-by: Jonathan Druart Signed-off-by: Kyle M Hall (cherry picked from commit b4d94a5ea4a3d9dac4295c53497cbb25e1b1212b) Signed-off-by: Julian Maurice --- reports/guided_reports.pl | 1 + 1 file changed, 1 insertion(+) diff --git a/reports/guided_reports.pl b/reports/guided_reports.pl index 954b75e850..0b7f538a31 100755 --- a/reports/guided_reports.pl +++ b/reports/guided_reports.pl @@ -824,6 +824,7 @@ elsif ($phase eq 'Export'){ } else { my $delimiter = C4::Context->preference('delimiter') || ','; if ( $format eq 'csv' ) { + $delimiter = "\t" if $delimiter eq 'tabulation'; $type = 'application/csv'; my $csv = Text::CSV::Encoded->new({ encoding_out => 'UTF-8', sep_char => $delimiter}); $csv or die "Text::CSV::Encoded->new({binary => 1}) FAILED: " . Text::CSV::Encoded->error_diag(); -- 2.39.5