From 6517e9c16d1a8f88bc69419a61af0478fd0a7be5 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 9 Apr 2015 15:49:14 +0200 Subject: [PATCH] Bug 9892: Make export_borrowers.pl using the delimiter pref The original concern of bug 9892 was that this borrowers export script cannot handle tabulation to separate columns. With this patch, the delimiter preference is used as separator for the output, to be consistent with others scripts. This should be highlighted on the release, it can produce change in behaviors. Test plan: Confirm that the 'delimiter' pref is used for the output, but you are able to overwrite it with the 'separator' parameter Signed-off-by: Bernardo Gonzalez Kriegel Works as expected, respect preference but is supeseeded by cmd line No koha-qa errors Signed-off-by: Marcel de Rooy Signed-off-by: Tomas Cohen Arazi --- misc/export_borrowers.pl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/misc/export_borrowers.pl b/misc/export_borrowers.pl index a9ecb3dc0a..4f29f31558 100755 --- a/misc/export_borrowers.pl +++ b/misc/export_borrowers.pl @@ -87,6 +87,11 @@ $query .= " ORDER BY borrowernumber"; my $sth = $dbh->prepare($query); $sth->execute; +unless ( $separator ) { + $separator = C4::Context->preference('delimiter') || ','; + $separator = "\t" if ($separator eq 'tabulation'); +} + my $csv = Text::CSV->new( { sep_char => $separator, binary => 1 } ); # If the user did not specify any field to export, we assume he wants them all -- 2.39.5