From a07e55628b448f810934824728894b9154f7f756 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 20 Dec 2013 15:24:49 +0100 Subject: [PATCH] Bug 10807: FIX conflicts with bug 10380 Bug 10380 changes the prototype of the output_pref routine. Now it should take a hashref in parameters. Without this patch, an error occurred if the user was not looged in and try to access to his search history (Template process failed: undef error - The 'day' parameter ("2013") to DateTime::new did not pass the 'an integer which is a possible valid day of month' callback") --- C4/Search/History.pm | 2 +- t/Search/History.t | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/C4/Search/History.pm b/C4/Search/History.pm index b120ab5..9dd5eb4 100644 --- a/C4/Search/History.pm +++ b/C4/Search/History.pm @@ -55,7 +55,7 @@ sub build_new_cookie_value { query_cgi => $query_cgi, total => "$total", type => $type, - time => output_pref( dt_from_string(), 'iso' ), + time => output_pref({ dt => dt_from_string(), dateformat => 'iso' }), }; shift @recent_searches if (@recent_searches > 15); diff --git a/t/Search/History.t b/t/Search/History.t index a340d16..fbb1322 100644 --- a/t/Search/History.t +++ b/t/Search/History.t @@ -23,7 +23,7 @@ my $first_search = C4::Search::History::build_new_cookie_value({ type => "biblio", }); -my $date = output_pref( dt_from_string(), 'iso' ); +my $date = output_pref({ dt => dt_from_string(), dateformat => 'iso' }); my @values = @{ C4::Search::History::get_from_cookie({cookie => $first_search}) }; my $values = shift @values; -- 1.7.10.4