From 7ac6b1b72cd8d6de8e03441adb4168918be1c799 Mon Sep 17 00:00:00 2001 From: Matt Blenkinsop Date: Wed, 20 Sep 2023 16:51:01 +0000 Subject: [PATCH] Bug 34587: Add report type and provider name to failed background job report Signed-off-by: Jessica Zairo Signed-off-by: Michaela Sieber Signed-off-by: Nick Clemens Signed-off-by: Tomas Cohen Arazi --- Koha/ERM/EUsage/UsageDataProvider.pm | 10 +++++----- .../background_jobs/erm_sushi_harvester.inc | 17 +++++++++++++++++ 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/Koha/ERM/EUsage/UsageDataProvider.pm b/Koha/ERM/EUsage/UsageDataProvider.pm index 1c7ae1443b..0f23a9367f 100644 --- a/Koha/ERM/EUsage/UsageDataProvider.pm +++ b/Koha/ERM/EUsage/UsageDataProvider.pm @@ -104,10 +104,11 @@ sub enqueue_sushi_harvest_jobs { my $job_id = Koha::BackgroundJob::ErmSushiHarvester->new->enqueue( { - ud_provider_id => $self->erm_usage_data_provider_id, - report_type => $report_type, - begin_date => $args->{begin_date}, - end_date => $args->{end_date}, + ud_provider_id => $self->erm_usage_data_provider_id, + report_type => $report_type, + begin_date => $args->{begin_date}, + end_date => $args->{end_date}, + ud_provider_name => $self->name, } ); @@ -172,7 +173,6 @@ sub harvest_sushi { $self->{report_type} = $args->{report_type}; $self->{begin_date} = $args->{begin_date}; $self->{end_date} = $args->{end_date}; - my $url = $self->_build_url_query; my $request = HTTP::Request->new( 'GET' => $url ); my $ua = LWP::UserAgent->new; diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/background_jobs/erm_sushi_harvester.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/background_jobs/erm_sushi_harvester.inc index fa28b9be3a..ee86b30c89 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/background_jobs/erm_sushi_harvester.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/background_jobs/erm_sushi_harvester.inc @@ -51,6 +51,17 @@ [% ELSIF job.status == 'started' %]

+ [% ELSIF job.status == 'failed' %] + + + + + + + + + +
Usage data provider
Report type
[% END %] [% IF job.status != 'finished' %] [% INCLUDE "job_progress.inc" job_id=job.id %] @@ -111,6 +122,12 @@ }); } }); + + let job_data = [% job.data %]; + let report_type = job_data.report_type; + let ud_provider_name = job_data.ud_provider_name; + $('#failed_report_type').text(report_type); + $('#failed_provider_name').text(ud_provider_name); }); -- 2.39.5