From e7d91c8fba757b0a0d2fc2d9901248064ee53921 Mon Sep 17 00:00:00 2001 From: Josef Moravec Date: Fri, 5 May 2017 08:46:34 +0000 Subject: [PATCH] Bug 8612: QA followup - strip white chars from csv profile definition, expand test --- C4/Acquisition.pm | 7 ++++++- t/db_dependent/Acquisition/GetBasketAsCSV.t | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/C4/Acquisition.pm b/C4/Acquisition.pm index 7a70852..01ffd4c 100644 --- a/C4/Acquisition.pm +++ b/C4/Acquisition.pm @@ -300,9 +300,14 @@ sub GetBasketAsCSV { ([^\|]*) # fieldname (table.row or row) \|? /gxms ) { - push @headers, $1; + my $header = $1; my $field = ($2 eq '') ? $1 : $2; + + $header =~ s/^\s+|\s+$//g; # Trim whitespaces + push @headers, $header; + $field =~ s/[^\.]*\.{1}//; # Remove the table name if exists. + $field =~ s/^\s+|\s+$//g; # Trim whitespaces push @fields, $field; } for my $order (@orders) { diff --git a/t/db_dependent/Acquisition/GetBasketAsCSV.t b/t/db_dependent/Acquisition/GetBasketAsCSV.t index 260bd85..b6dfdbe 100644 --- a/t/db_dependent/Acquisition/GetBasketAsCSV.t +++ b/t/db_dependent/Acquisition/GetBasketAsCSV.t @@ -42,7 +42,7 @@ my $csv_profile2 = Koha::CsvProfile->new({ profile => 'my user profile', type => 'export_basket', csv_separator => ',', - content => 'biblio.author|title=biblio.title|quantity=aqorders.quantity', + content => 'biblio.author | title = biblio.title|quantity=aqorders.quantity', })->store; my $basketno; -- 2.1.4