Bug 18696: Change debian/source/format to quilt
[koha.git] / svc / report
index da1b9b3..0188eaa 100755 (executable)
@@ -25,7 +25,7 @@ use C4::Reports::Guided;
 use JSON;
 use CGI qw ( -utf8 );
 
-use Koha::Cache;
+use Koha::Caches;
 
 
 my $query  = CGI->new();
@@ -48,7 +48,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
     }
 );
 
-my $cache = Koha::Cache->get_instance();
+my $cache = Koha::Caches->get_instance();
 my $cache_active = $cache->is_cache_active;
 my ($cache_key, $json_text);
 if ($cache_active) {
@@ -65,7 +65,7 @@ unless ($json_text) {
     # convert SQL parameters to placeholders
     $sql =~ s/(<<.*?>>)/\?/g;
 
-    my ( $sth, $errors ) = execute_query( $sql, $offset, $limit, \@sql_params );
+    my ( $sth, $errors ) = execute_query( $sql, $offset, $limit, \@sql_params, $report_id );
     if ($sth) {
         my $lines;
         if ($report_annotation) {
@@ -77,7 +77,7 @@ unless ($json_text) {
         $json_text = encode_json($lines);
 
         if ($cache_active) {
-            $cache->set_in_cache( $cache_key, $json_text, $report_rec->{cache_expiry} );
+            $cache->set_in_cache( $cache_key, $json_text, { expiry => $report_rec->{cache_expiry} } );
         }
     }
     else {