From d57ebd2e2b019b0791eed124ba1a99617edfed75 Mon Sep 17 00:00:00 2001 From: Aleisha Amohia Date: Tue, 29 Aug 2017 21:07:39 +0000 Subject: [PATCH] Bug 19200: Preventing warns when exporting a basket To test: 1) Go to Tools -> CSV profiles -> New CSV Profile 2) Create a new CSV profile with any name of SQL fields. Ensure profile type: SQL and usage: basket export in acquisition 3) Go to Acquisitions -> Find or create a vendor -> Use or create a basket 4) Click the dropdown menu next to the 'Export as CSV' button. There should be a 'Default' option and your new CSV profile (at least) 5) Click the 'Default' option. Notice warns 6) Click the 'Export as CSV' button. Notice warns 7) Click your new CSV profile option. Notice warns 8) Apply patch and refresh page 9) Repeat steps 5-7, confirm that warns do not show 10) Confirm export still works as expected Sponsored-by: Catalyst IT --- acqui/basket.pl | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/acqui/basket.pl b/acqui/basket.pl index 7a039d4..07a304a 100755 --- a/acqui/basket.pl +++ b/acqui/basket.pl @@ -170,11 +170,13 @@ if ( $op eq 'delete_confirm' ) { -type => 'text/csv', -attachment => 'basket' . $basket->{'basketno'} . '.csv', ); - if ( $query->param('csv_profile') eq 'default'){ - print GetBasketAsCSV($query->param('basketno'), $query); + my $csv_profile_id = $query->param('csv_profile'); + if (defined $csv_profile_id) { + # using a csv profile + print GetBasketAsCSV(scalar $query->param('basketno'), $query, $csv_profile_id); } else { - my $csv_profile_id = $query->param('csv_profile'); - print GetBasketAsCSV($query->param('basketno'), $query, $csv_profile_id); + # using default + print GetBasketAsCSV(scalar $query->param('basketno'), $query); } exit; } elsif ($op eq 'email') { -- 2.1.4