Bug 6614: Remove newlines from order notes when exporting to CSV

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 <nengard@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
(cherry picked from commit 68f99cdf98)

Signed-off-by: Chris Nighswonger <chris.nighswonger@gmail.com>
This commit is contained in:
Ian Walls 2011-07-26 14:22:53 -04:00 committed by Chris Nighswonger
parent e8f6412c1f
commit d5c1929ed1
1 changed files with 2 additions and 0 deletions

View File

@ -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'},