From 92023f7377004d948e49a49a01ad7788ad5919f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Demians?= Date: Sat, 17 Sep 2011 08:02:54 +0200 Subject: [PATCH 2/2] Bug 6679 Followup for acqui/histsearch.pl --- acqui/histsearch.pl | 10 ++++++---- 1 files changed, 6 insertions(+), 4 deletions(-) diff --git a/acqui/histsearch.pl b/acqui/histsearch.pl index e158842..82ba04f 100755 --- a/acqui/histsearch.pl +++ b/acqui/histsearch.pl @@ -64,8 +64,10 @@ my $author = $input->param('author'); my $name = $input->param( 'name' ); my $basket = $input->param( 'basket' ); my $booksellerinvoicenumber = $input->param( 'booksellerinvoicenumber' ); -my $from_placed_on = C4::Dates->new($input->param('from')) if $input->param('from'); -my $to_placed_on = C4::Dates->new($input->param( 'to')) if $input->param('to'); +my $from_placed_on = $input->param('from'); +$from_placed_on = C4::Dates->new($from_placed_on) if $from_placed_on; +my $to_placed_on = $input->param('to'); +$to_placed_on = C4::Dates->new($to_placed_on) if $to_placed_on; my $dbh = C4::Context->dbh; my ( $template, $loggedinuser, $cookie ) = get_template_and_user( @@ -103,8 +105,8 @@ if ($do_search) { ); } -my $from_date = $from_placed_on->output('syspref') if $from_placed_on; -my $to_date = $to_placed_on->output('syspref') if $to_placed_on; +my $from_date = $from_placed_on ? $from_placed_on->output('syspref') : undef; +my $to_date = $to_placed_on ? $to_placed_on->output('syspref') : undef; $template->param( suggestions_loop => $order_loop, -- 1.7.6.1