From: Ian Walls <ian.wa...@bywatersolutions.com>

Newline is not a valid character to Text::CSV's combine() subroutine.  If an 
order
contained a note with a newline in it, that line would come out as a blank 
entry in
the exported CSV.  This patch strips such characters, globally.

Signed-off-by: Nicole C. Engard <neng...@bywatersolutions.com>
---
 C4/Acquisition.pm |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/C4/Acquisition.pm b/C4/Acquisition.pm
index 09cb39c..738fe16 100644
--- a/C4/Acquisition.pm
+++ b/C4/Acquisition.pm
@@ -241,6 +241,8 @@ sub GetBasketAsCSV {
     my @rows;
     foreach my $order (@orders) {
        my @cols;
+       # newlines are not valid characters for Text::CSV combine()
+        $order->{'notes'} =~ s/[\r\n]+//g;
        push(@cols,
                $contract->{'contractname'},
                $order->{'ordernumber'},
-- 
1.7.2.3

_______________________________________________
Koha-patches mailing list
Koha-patches@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-patches
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to