Lines 34-41
my $report_id = $query->param('id');
Link Here
|
34 |
my $report_name = $query->param('name'); |
34 |
my $report_name = $query->param('name'); |
35 |
my $report_annotation = $query->param('annotated'); |
35 |
my $report_annotation = $query->param('annotated'); |
36 |
|
36 |
|
37 |
my $report_rec = Koha::Reports->find( $report_name ? { 'name' => $report_name } : { 'id' => $report_id } ); |
37 |
my $report_recs = Koha::Reports->search( $report_name ? { 'report_name' => $report_name } : { 'id' => $report_id } ); |
38 |
if (!$report_rec) { die "There is no such report.\n"; } |
38 |
if (!$report_recs || $report_recs->count == 0 ) { die "There is no such report.\n"; } |
|
|
39 |
my $report_rec = $report_recs->next(); |
39 |
|
40 |
|
40 |
my @sql_params = $query->param('sql_params'); |
41 |
my @sql_params = $query->param('sql_params'); |
41 |
|
42 |
|
Lines 53-59
my $cache = Koha::Caches->get_instance();
Link Here
|
53 |
my $cache_active = $cache->is_cache_active; |
54 |
my $cache_active = $cache->is_cache_active; |
54 |
my ($cache_key, $json_text); |
55 |
my ($cache_key, $json_text); |
55 |
if ($cache_active) { |
56 |
if ($cache_active) { |
56 |
$cache_key = "intranet:report:".($report_name ? "name:$report_name" : "id:$report_id") |
57 |
$cache_key = "intranet:report:".($report_name ? "report_name:$report_name" : "id:$report_id") |
57 |
. join( '-', @sql_params ); |
58 |
. join( '-', @sql_params ); |
58 |
$json_text = $cache->get_from_cache($cache_key); |
59 |
$json_text = $cache->get_from_cache($cache_key); |
59 |
} |
60 |
} |
60 |
- |
|
|