From 9060ca36c08f6f5ff2b5790ae163cd43758a7fd8 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Fri, 28 Feb 2020 16:48:37 +0000 Subject: [PATCH] Bug 23753: Add missing humanMsg library to pages using background job JavaScript The JavaScript used to process background uploads calls the humanMsg library under some circumstances. There are several templates which use background-job-progressbar.js which don't include the humanMsg assets. This patch corrects those templates. Note: upload-images.tt has been modified to remove the inclusion of background-job-progressbar.js because it was unused. To test, apply the patch and test the following processes which include background job processing: - Batch item modification -- the background job is triggered when you submit your changes - Batch record modification -- the background job is triggered when you submit your changes - Stage MARC for import -- the background job is triggered when you click the "Sage for import" button after uploading a file - Staged MARC management -- the background job is triggered when you click "Import this batch into the catalog" In each case the process should complete correctly. If you would like to test the error message handling provided by the humanMsg library you can deliberately introduce an error into the JavaScript. After applying the patch you can modify js/background-job-progressbar.js to alter line 63 from: url: f.action, ...to: url: f.action + "foo", Perform the same tests and confirm that you see an error message. Don't forget to undo your changes to background-job-progressbar.js before signing off. Signed-off-by: Maryse Simard Signed-off-by: Katrin Fischer Signed-off-by: Martin Renvoize --- koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-edit.tt | 3 ++- .../prog/en/modules/tools/batch_record_modification.tt | 2 ++ .../intranet-tmpl/prog/en/modules/tools/manage-marc-import.tt | 2 ++ .../intranet-tmpl/prog/en/modules/tools/stage-marc-import.tt | 2 +- koha-tmpl/intranet-tmpl/prog/en/modules/tools/upload-images.tt | 1 - 5 files changed, 7 insertions(+), 3 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-edit.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-edit.tt index 965722e5d1..e34cee89a0 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-edit.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-edit.tt @@ -4,6 +4,7 @@ [% INCLUDE 'doc-head-open.inc' %] Koha › Tools › Batch item modification [% INCLUDE 'doc-head-close.inc' %] +[% Asset.js("lib/jquery/plugins/humanmsg.js") | $raw %] [% Asset.js("js/background-job-progressbar.js") | $raw %] [% Asset.js("js/cataloging.js") | $raw %] [% INCLUDE 'datatables.inc' %] @@ -64,7 +65,7 @@ $(document).ready(function(){ [% Asset.css("css/addbiblio.css") | $raw %] - +[% Asset.css("css/humanmsg.css") | $raw %] [% INCLUDE 'select2.inc' %]