diff --git a/C4/Context.pm b/C4/Context.pm index ea9314eb50..490d604226 100644 --- a/C4/Context.pm +++ b/C4/Context.pm @@ -482,8 +482,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 @@ -493,7 +493,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 2ffc076e55..b3f80f22f2 100644 --- a/installer/data/mysql/mandatory/sysprefs.sql +++ b/installer/data/mysql/mandatory/sysprefs.sql @@ -174,7 +174,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" );