Bug 10807: (follow-up) use 24-hour time when storing search times to session
authorGalen Charlton <gmc@esilibrary.com>
Mon, 5 May 2014 02:55:41 +0000 (02:55 +0000)
committerGalen Charlton <gmc@esilibrary.com>
Mon, 5 May 2014 02:55:41 +0000 (02:55 +0000)
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>
C4/Auth.pm
C4/Search/History.pm

index 006a990..24e0bf1 100644 (file)
@@ -260,7 +260,6 @@ sub get_template_and_user {
             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 (?, ?, ?, ?, ?, ?, ?)
index e24a65a..d82d14e 100644 (file)
@@ -49,7 +49,7 @@ sub add_to_session {
         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 );