Bugzilla – Attachment 94027 Details for
Bug 23753
Add missing humanMsg library to pages using background job JavaScript
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23753: Background job JavaScript should not try to call humanMsg library
Bug-23753-Background-job-JavaScript-should-not-try.patch (text/plain), 3.83 KB, created by
Owen Leonard
on 2019-10-11 17:33:44 UTC
(
hide
)
Description:
Bug 23753: Background job JavaScript should not try to call humanMsg library
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2019-10-11 17:33:44 UTC
Size:
3.83 KB
patch
obsolete
>From a1ac3aec36c0709a3e183084bbc19d4010fa5217 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >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 @@ > </div> > > [% MACRO jsinclude BLOCK %] >- [% Asset.js("js/background-job-progressbar.js") | $raw %] > [% Asset.js("js/file-upload.js") | $raw %] > <script type="text/javascript"> > var xhr; >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/upload-images.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/upload-images.tt >index b341800702..ac771fd61e 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/upload-images.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/upload-images.tt >@@ -114,7 +114,6 @@ > > [% MACRO jsinclude BLOCK %] > [% Asset.js("js/tools-menu.js") | $raw %] >- [% Asset.js("js/background-job-progressbar.js") | $raw %] > [% Asset.js("js/file-upload.js") | $raw %] > <script> > function StartUpload() { >diff --git a/koha-tmpl/intranet-tmpl/prog/js/background-job-progressbar.js b/koha-tmpl/intranet-tmpl/prog/js/background-job-progressbar.js >index 5ddb4053c2..81bc1604bd 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/background-job-progressbar.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/background-job-progressbar.js >@@ -69,7 +69,9 @@ function submitBackgroundJob(f) { > backgroundJobProgressTimer = setInterval("updateJobProgress()", 500); > }, > error: function(xml, textStatus) { >- humanMsg.displayMsg( '<p>' + _('Import of record(s) failed: ') + textStatus + '</p></br>'+xml.responseText, { className: 'humanError' } ); >+ alert("Operations failed: " + textStatus + "\n" + xml.responseText ); >+ $("#jobpanel").hide(); >+ $("#mainformsubmit").prop("disabled", false ); > } > > }); >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 23753
:
94027
|
99786
|
99790
|
99828