View | Details | Raw Unified | Return to bug 20495
Collapse All | Expand All

(-)a/opac/svc/report (-2 / +3 lines)
Lines 35-42 my $report_id = $query->param('id'); Link Here
35
my $report_name = $query->param('name');
35
my $report_name = $query->param('name');
36
my $report_annotation = $query->param('annotated');
36
my $report_annotation = $query->param('annotated');
37
37
38
my $report_rec = Koha::Reports->find( $report_name ? { 'name' => $report_name } : { 'id' => $report_id } );
38
my $report_recs = Koha::Reports->search( $report_name ? { 'report_name' => $report_name } : { 'id' => $report_id } );
39
if (!$report_rec) { die "There is no such report.\n"; }
39
if ( !$report_recs || $report_recs->count == 0 ) { die "There is no such report.\n"; }
40
my $report_rec = $report_recs->next();
40
41
41
die "Sorry this report is not public\n" unless $report_rec->public;
42
die "Sorry this report is not public\n" unless $report_rec->public;
42
43
(-)a/svc/report (-4 / +4 lines)
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
- 

Return to bug 20495