Bugzilla – Attachment 136537 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: (follow-up) Comma as default CSV delimiter
Bug-28327-follow-up-Comma-as-default-CSV-delimiter.patch (text/plain), 4.39 KB, created by
David Nind
on 2022-06-24 22:15:35 UTC
(
hide
)
Description:
Bug 28327: (follow-up) Comma as default CSV delimiter
Filename:
MIME Type:
Creator:
David Nind
Created:
2022-06-24 22:15:35 UTC
Size:
4.39 KB
patch
obsolete
>From 87b51a1b3d89de13ad3f4bf017544e025f81a077 Mon Sep 17 00:00:00 2001 >From: Fridolin Somers <fridolin.somers@biblibre.com> >Date: Thu, 23 Jun 2022 21:38:11 -1000 >Subject: [PATCH] Bug 28327: (follow-up) Comma as default CSV delimiter > >Looks like most of existing code wants comma as default value. > >Also impact installer/data/mysql/mandatory/sysprefs.sql. > >Signed-off-by: David Nind <david@davidnind.com> >--- > C4/Context.pm | 6 +++--- > installer/data/mysql/mandatory/sysprefs.sql | 2 +- > t/Context.t | 8 ++++---- > 3 files changed, 8 insertions(+), 8 deletions(-) > >diff --git a/C4/Context.pm b/C4/Context.pm >index 876126b888..654414de3c 100644 >--- a/C4/Context.pm >+++ b/C4/Context.pm >@@ -483,8 +483,8 @@ sub delete_preference { > > $delimiter = C4::Context->csv_delimiter; > >- Returns prefered CSV delimiter, using system preference 'CSVDelimiter'. >- If this preference is missing or empty semicolon will be returned. >+ Returns preferred CSV delimiter, using system preference 'CSVDelimiter'. >+ If this preference is missing or empty, comma will be returned. > This method is needed because of special behavior for tabulation. > > You can, optionally, pass a value parameter to this routine >@@ -494,7 +494,7 @@ sub delete_preference { > > sub csv_delimiter { > my ( $self, $value ) = @_; >- my $delimiter = $value || $self->preference('CSVDelimiter') || ';'; >+ my $delimiter = $value || $self->preference('CSVDelimiter') || ','; > $delimiter = "\t" if $delimiter eq 'tabulation'; > return $delimiter; > } >diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql >index d2c7ee3bec..71c6b59e38 100644 >--- a/installer/data/mysql/mandatory/sysprefs.sql >+++ b/installer/data/mysql/mandatory/sysprefs.sql >@@ -177,7 +177,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('DefaultToLoggedInLibraryCircRules', '0', NULL , 'If enabled, circ rules editor will default to the logged in library''s rules, rather than the ''all libraries'' rules.', 'YesNo'), > ('DefaultToLoggedInLibraryNoticesSlips', '0', NULL , 'If enabled,slips and notices editor will default to the logged in library''s rules, rather than the ''all libraries'' rules.', 'YesNo'), > ('DefaultToLoggedInLibraryOverdueTriggers', '0', NULL , 'If enabled, overdue status triggers editor will default to the logged in library''s rules, rather than the ''default'' rules.', 'YesNo'), >-('CSVDelimiter',';',';|tabulation|,|/|\\|#||','Define the default separator character for exporting reports','Choice'), >+('CSVDelimiter',',',';|tabulation|,|/|\\|#||','Define the default separator character for exporting reports','Choice'), > ('Display856uAsImage','OFF','OFF|Details|Results|Both','Display the URI in the 856u field as an image, the corresponding staff interface XSLT option must be on','Choice'), > ('DisplayClearScreenButton','0','','If set to ON, a clear screen button will appear on the circulation page.','YesNo'), > ('displayFacetCount','0',NULL,NULL,'YesNo'), >diff --git a/t/Context.t b/t/Context.t >index 8d353e35f6..f3e15a56c1 100755 >--- a/t/Context.t >+++ b/t/Context.t >@@ -68,13 +68,13 @@ subtest 'csv_delimiter() tests' => sub { > plan tests => 4; > > t::lib::Mocks::mock_preference( 'CSVDelimiter', undef ); >- is( C4::Context->csv_delimiter, ';', "csv_delimiter returns semicolon if system preference CSVDelimiter is undefined" ); >+ is( C4::Context->csv_delimiter, ',', "csv_delimiter returns comma if system preference CSVDelimiter is undefined" ); > > t::lib::Mocks::mock_preference( 'CSVDelimiter', '' ); >- is( C4::Context->csv_delimiter, ';', "csv_delimiter returns semicolon if system preference CSVDelimiter is empty string" ); >+ is( C4::Context->csv_delimiter, ',', "csv_delimiter returns comma if system preference CSVDelimiter is empty string" ); > >- t::lib::Mocks::mock_preference( 'CSVDelimiter', ',' ); >- is( C4::Context->csv_delimiter, ',', "csv_delimiter returns comma if system preference CSVDelimiter is comma" ); >+ t::lib::Mocks::mock_preference( 'CSVDelimiter', ';' ); >+ is( C4::Context->csv_delimiter, ';', "csv_delimiter returns semicolon if system preference CSVDelimiter is semicolon" ); > > t::lib::Mocks::mock_preference( 'CSVDelimiter', 'tabulation' ); > is( C4::Context->csv_delimiter, "\t", "csv_delimiter returns '\t' if system preference CSVDelimiter is tabulation" ); >-- >2.30.2
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