From e74c2ab4728dfdc932cd290db005ce2250e9d61b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Wed, 13 May 2009 14:46:40 +0000 Subject: [PATCH] Druckerauswahl war nicht korrekt bei leerer Druckermenge. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Fix für Bug 934. --- bin/mozilla/bp.pl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bin/mozilla/bp.pl b/bin/mozilla/bp.pl index edbd98486..654a26776 100644 --- a/bin/mozilla/bp.pl +++ b/bin/mozilla/bp.pl @@ -33,6 +33,7 @@ use SL::BP; use Data::Dumper; +use List::Util qw(first); 1; @@ -348,7 +349,10 @@ sub print { $form->get_lists(printers => 'ALL_PRINTERS'); # use the command stored in the databse or fall back to $myconfig{printer} - my $selected_printer = (grep { $_->{id} eq $form->{printer} } @{ $form->{ALL_PRINTERS} })[0]->{'printer_command'} || $myconfig{printer}; + my $selected_printer = first { $_ } map ({ $_ ->{printer_command} } + grep { $_->{id} eq $form->{printer} } + @{ $form->{ALL_PRINTERS} }), + $myconfig{printer}; if ($form->{callback}) { map { $form->{callback} .= "&checked_$_=1" if $form->{"checked_$_"} } -- 2.20.1