From fc0841f55432464c6e73eb485b2babd0f7598133 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 4 Jul 2018 15:05:25 -0300 Subject: [PATCH] Bug 21035: Handle new lines when running reports See https://metacpan.org/pod/Text::CSV_XS#Embedded-newlines Test plan: 1) Choose two items, say barcode '123' and '456' 2) Change the public note on 123 to read Line1 Line2 (I.e. type 'Line1', then press Enter, type 'Line2' and click update). 3) Change the public note on 456 to read Public note has one and only one line. Click update. 4) Create a report with the followng query: select barcode, itemnotes from items where barcode in ( '123', '456' ) Let's say that this is report number 10. 5) run ./misc/cronjobs/runreport.pl --format=csv REPORT_ID: => You should see both lines Signed-off-by: Maryse Simard Followed the test plan and it works. Signed-off-by: Katrin Fischer Signed-off-by: Nick Clemens (cherry picked from commit f16fb888f132703063f0591e329d72d065f4b1d9) Signed-off-by: Martin Renvoize (cherry picked from commit 4fd18a7df711f5a59f459234ec186b175ee05eb6) Signed-off-by: Fridolin Somers --- misc/cronjobs/runreport.pl | 1 + 1 file changed, 1 insertion(+) diff --git a/misc/cronjobs/runreport.pl b/misc/cronjobs/runreport.pl index 1648f4d72a..848a405bba 100755 --- a/misc/cronjobs/runreport.pl +++ b/misc/cronjobs/runreport.pl @@ -270,6 +270,7 @@ foreach my $report_id (@ARGV) { $message = $cgi->table(join "", @rows); } elsif ($format eq 'csv') { my $csv = Text::CSV_XS->new({ + binary => 1, quote_char => $quote, sep_char => $separator, }); -- 2.39.5