From 6cba61452ba32796b987266dd43f318fa34b36c6 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Wed, 30 Mar 2022 12:25:55 +0000 Subject: [PATCH] Bug 26669: (QA follow-up) Update last run when report run by name This alters the svc scripts to set the report id after fetchign the report object to ensure it is passed to exectue query Signed-off-by: Nick Clemens --- opac/svc/report | 3 +++ svc/report | 3 +++ 2 files changed, 6 insertions(+) diff --git a/opac/svc/report b/opac/svc/report index 5e6e50d94f..434cd4a13e 100755 --- a/opac/svc/report +++ b/opac/svc/report @@ -37,9 +37,12 @@ my $report_name = $query->param('name'); my $report_annotation = $query->param('annotated'); my $report_recs = Koha::Reports->search( $report_name ? { 'report_name' => $report_name } : { 'id' => $report_id } ); + if ( !$report_recs || $report_recs->count == 0 ) { die "There is no such report.\n"; } my $report_rec = $report_recs->next(); +$report_id = $report_rec->id; + die "Sorry this report is not public\n" unless $report_rec->public; my @sql_params = $query->multi_param('sql_params'); diff --git a/svc/report b/svc/report index 209df383ca..5d91494f93 100755 --- a/svc/report +++ b/svc/report @@ -35,9 +35,12 @@ my $report_name = $query->param('name'); my $report_annotation = $query->param('annotated'); my $report_recs = Koha::Reports->search( $report_name ? { 'report_name' => $report_name } : { 'id' => $report_id } ); + if (!$report_recs || $report_recs->count == 0 ) { die "There is no such report.\n"; } my $report_rec = $report_recs->next(); +$report_id = $report_rec->id; + my @sql_params = $query->multi_param('sql_params'); my @param_names = $query->multi_param('param_names'); -- 2.30.2