From fae07abcc69e430c84f7b4f3241c1fe21e7bd5ab Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fr=C3=A9d=C3=A9ric=20Demians?= Date: Sat, 17 Sep 2011 08:02:54 +0200 Subject: [PATCH] Bug 6679 Followup for acqui/histsearch.pl Signed-off-by: Chris Cormack --- acqui/histsearch.pl | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/acqui/histsearch.pl b/acqui/histsearch.pl index e15884228e..82ba04f618 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, -- 2.39.5