This ensures that if an anonymous session is converted to a logged-in
session, that search history times from the anonymous session get
stored corectly.
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
my @recentSearches = C4::Search::History::get_from_session({ cgi => $in->{'query'} });
if (@recentSearches) {
my $dbh = C4::Context->dbh;
-
my $query = q{
INSERT INTO search_history(userid, sessionid, query_desc, query_cgi, type, total, time )
VALUES (?, ?, ?, ?, ?, ?, ?)
query_cgi => $query_cgi,
total => "$total",
type => $type,
- time => output_pref( { dt => dt_from_string(), dateformat => 'iso' } ),
+ time => output_pref( { dt => dt_from_string(), dateformat => 'iso', timeformat => '24hr' } ),
};
shift @recent_searches if ( @recent_searches > 15 );