From a1ac3aec36c0709a3e183084bbc19d4010fa5217 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Fri, 11 Oct 2019 16:52:11 +0000 Subject: [PATCH] Bug 23753: Background job JavaScript should not try to call humanMsg library This patch modifies the JavaScript file which handles background jobs so that it doesn't try to call the HumanMsg JavaScript library. It now will show errors in an alert. The patch also adds a couple of lines of JS to hide the progressbar and re-enable the submit button when an error is triggered. To test you'll need to introduce a problem with AJAX operations so that the error message will be triggered. 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 following tests and confirm that an error message is shown in an alert: Tools -> Batch record modification - Test the process of uploading a file of biblionumbers Tools -> Batch item modification - Test the process of uploading a file of barcodes Tools -> Stage MARC records for import - Test the process of staging an uploaded file for import Tools -> Staged MARC record management - Test the process of importing a staged file The background-jobs JS was not used on these pages and has been removed: Tools -> Upload local cover image - Test the process of uploading cover images Circulation -> Upload offline circulation data - Test the process of uploading a .koc file Don't forget to undo your change to background-job-progressbar.js before signing off. --- koha-tmpl/intranet-tmpl/prog/en/modules/offline_circ/process_koc.tt | 1 - koha-tmpl/intranet-tmpl/prog/en/modules/tools/upload-images.tt | 1 - koha-tmpl/intranet-tmpl/prog/js/background-job-progressbar.js | 4 +++- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/offline_circ/process_koc.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/offline_circ/process_koc.tt index 497b109120..2a0a0b0b24 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/offline_circ/process_koc.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/offline_circ/process_koc.tt @@ -69,7 +69,6 @@ [% MACRO jsinclude BLOCK %] - [% Asset.js("js/background-job-progressbar.js") | $raw %] [% Asset.js("js/file-upload.js") | $raw %]