Bug 4188 Valid PDF file name when printing basket group with no name
authorFrédéric Demians <f.demians@tamil.fr>
Sat, 3 Jul 2010 14:32:44 +0000 (16:32 +0200)
committerGalen Charlton <gmcharlt@gmail.com>
Tue, 6 Jul 2010 12:20:31 +0000 (08:20 -0400)
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
acqui/basketgroup.pl

index a3b7dc9..69de099 100755 (executable)
@@ -238,7 +238,10 @@ sub printbasketgrouppdf{
         }
         $orders{$basket->{basketno}}=\@ba_orders;
     }
-    print $input->header( -type => 'application/pdf', -attachment => $basketgroup->{name}.'.pdf' );
+    print $input->header(
+        -type       => 'application/pdf',
+        -attachment => ( $basketgroup->{name} || $basketgroupid ) . '.pdf'
+    );
     my $pdf = printpdf($basketgroup, $bookseller, $baskets, \%orders, $bookseller->{gstrate} || C4::Context->preference("gist")) || die "pdf generation failed";
     print $pdf;
     exit;