Bug 8168: (follow-up) Use semicolon as default CSV delimiter
authorJonathan Druart <jonathan.druart@biblibre.com>
Fri, 24 Jan 2014 11:49:39 +0000 (12:49 +0100)
committerKyle M Hall <kyle@bywatersolutions.com>
Fri, 13 Jun 2014 13:01:39 +0000 (09:01 -0400)
installer/data/mysql/sysprefs.sql has semicolon as default.
This fixes both instances to use the same fallback value.

It also prevents CSV header info from being included in non-CSV messages.

Signed-off-by: wajasu <matted-34813@mypacks.net>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 7408fa5d7087fad5c8f15b742b9624cbfe652a61)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 33e32758999c47549fba392f8c67fc0ca2917b3f)

misc/cronjobs/overdue_notices.pl

index 6832450..040165a 100755 (executable)
@@ -356,7 +356,7 @@ binmode( STDOUT, ':encoding(UTF-8)' );
 our $csv;       # the Text::CSV_XS object
 our $csv_fh;    # the filehandle to the CSV file.
 if ( defined $csvfilename ) {
-    my $sep_char = C4::Context->preference('delimiter') || ',';
+    my $sep_char = C4::Context->preference('delimiter') || ';';
     $sep_char = "\t" if ($sep_char eq 'tabulation');
     $csv = Text::CSV_XS->new( { binary => 1 , sep_char => $sep_char } );
     if ( $csvfilename eq '' ) {
@@ -619,7 +619,7 @@ END_SQL
         # Generate the content of the csv with headers
         my $content;
         if ( defined $csvfilename ) {
-            my $delimiter = C4::Context->preference('delimiter') // ';';
+            my $delimiter = C4::Context->preference('delimiter') || ';';
             $content = join($delimiter, qw(title name surname address1 address2 zipcode city country email itemcount itemsinfo due_date issue_date)) . "\n";
         }
         else {