Bugzilla – Attachment 126966 Details for
Bug 28327
System preference CSVdelimiter special case for tabulation
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28327: CSVdelimiter special case for tabulation in perl
Bug-28327-CSVdelimiter-special-case-for-tabulation.patch (text/plain), 3.19 KB, created by
Nick Clemens (kidclamp)
on 2021-10-27 11:12:46 UTC
(
hide
)
Description:
Bug 28327: CSVdelimiter special case for tabulation in perl
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2021-10-27 11:12:46 UTC
Size:
3.19 KB
patch
obsolete
>From 16d6233ea34c514791431c7b61c6f98541c29890 Mon Sep 17 00:00:00 2001 >From: Fridolin Somers <fridolin.somers@biblibre.com> >Date: Wed, 12 May 2021 15:23:14 +0200 >Subject: [PATCH] Bug 28327: CSVdelimiter special case for tabulation in perl > >System preference 'CSVdelimiter' has a special case for tabulation. >Preference value contains string 'tabulation' but string '\t' must be used in CSV file. > >This is OK in many places, for exemple Bug 17590. > >This patch fixed when preference is fetch in perl. > >Test plan : >1) Set system preference 'CSVdelimiter' = 'tabs'. >2) Create CSV export in impacted pages >3) Check columns are separated by tabulation character and not string 'tabulation' > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > admin/aqplan.pl | 1 + > misc/cronjobs/overdue_notices.pl | 1 + > reports/cash_register_stats.pl | 1 + > tools/viewlog.pl | 3 ++- > 4 files changed, 5 insertions(+), 1 deletion(-) > >diff --git a/admin/aqplan.pl b/admin/aqplan.pl >index 64b6cd05ab..d87794f564 100755 >--- a/admin/aqplan.pl >+++ b/admin/aqplan.pl >@@ -98,6 +98,7 @@ my $show_percent = $input->param('show_percent'); > my $output = $input->param("output") // q{}; > our $basename = $input->param("basename"); > our $del = $input->param("sep"); >+$del = "\t" if $del eq 'tabulation'; > > my $show_mine = $input->param('show_mine') ; > >diff --git a/misc/cronjobs/overdue_notices.pl b/misc/cronjobs/overdue_notices.pl >index a1c2211628..306c7a0aee 100755 >--- a/misc/cronjobs/overdue_notices.pl >+++ b/misc/cronjobs/overdue_notices.pl >@@ -842,6 +842,7 @@ END_SQL > my $content; > if ( defined $csvfilename ) { > my $delimiter = C4::Context->preference('CSVDelimiter') || ';'; >+ $delimiter = "\t" if $delimiter eq 'tabulation'; > $content = join($delimiter, qw(title name surname address1 address2 zipcode city country email itemcount itemsinfo due_date issue_date)) . "\n"; > } > else { >diff --git a/reports/cash_register_stats.pl b/reports/cash_register_stats.pl >index e043044844..f51ca41141 100755 >--- a/reports/cash_register_stats.pl >+++ b/reports/cash_register_stats.pl >@@ -157,6 +157,7 @@ if ($do_it) { > my $reportname = $input->param('basename'); > my $reportfilename = $reportname ? "$reportname.$format" : "reportresults.$format" ; > my $delimiter = C4::Context->preference('CSVDelimiter') || ','; >+ $delimiter = "\t" if $delimiter eq 'tabulation'; > my @rows; > foreach my $row (@loopresult) { > my @rowValues; >diff --git a/tools/viewlog.pl b/tools/viewlog.pl >index 5909cb39ed..67e31a88b9 100755 >--- a/tools/viewlog.pl >+++ b/tools/viewlog.pl >@@ -219,8 +219,9 @@ if ($do_it) { > > # Printing to a csv file > my $content = q{}; >- my $delimiter = C4::Context->preference('CSVDelimiter') || ','; > if (@data) { >+ my $delimiter = C4::Context->preference('CSVDelimiter') || ','; >+ $delimiter = "\t" if $delimiter eq 'tabulation'; > my $csv = Text::CSV::Encoded->new( { encoding_out => 'utf8', sep_char => $delimiter } ); > $csv or die "Text::CSV::Encoded->new FAILED: " . Text::CSV::Encoded->error_diag(); > >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 28327
:
120859
|
120861
|
120867
|
120868
|
120869
|
120870
|
120871
|
120872
|
120873
|
120874
|
120876
|
120877
|
120878
|
120879
|
120880
|
120881
|
126682
|
126683
|
126684
|
126685
|
126964
|
126965
|
126966
|
126967
|
131995
|
131996
|
131997
|
136378
|
136379
|
136380
|
136381
|
136473
|
136474
|
136475
|
136535
|
136536
|
136537
|
139479
|
139513
|
139514
|
139515
|
139516