[Bug 23753] New: Background job JavaScript should not try to call humanMsg library
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23753 Bug ID: 23753 Summary: Background job JavaScript should not try to call humanMsg library Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Templates Assignee: oleonard@myacpl.org Reporter: oleonard@myacpl.org QA Contact: testopia@bugs.koha-community.org While trying to fix Bug 8645 I noticed that background-job-progressbar.js has error-handling code which tries to call the "humanMsg" function which is defined in the "HUMANIZED MESSAGES" plugin humanmsg.js. The plugin is currently loaded on the following pages: admin\preferences.tt cataloguing\editor.tt tools\stage-marc-import.tt Whereas background-job-progressbar.js is used on these pages: offline_circ\process_koc.tt tools\batch_record_modification.tt tools\batchMod-edit.tt tools\manage-marc-import.tt tools\stage-marc-import.tt tools\upload-images.tt The background job error handling doesn't do anything other than return the AJAX error message, so I don't think it's worth it to add the humanmsg plugin everywhere. Better, I think, to change it to an alert. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23753 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Trivial patch Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23753 --- Comment #1 from Owen Leonard <oleonard@myacpl.org> --- Created attachment 94027 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=94027&action=edit 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. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23753 Cori Lynn Arnold <carnold@dgiinc.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |carnold@dgiinc.com Status|Needs Signoff |Failed QA --- Comment #2 from Cori Lynn Arnold <carnold@dgiinc.com> --- I tested these and they worked as expected with the alert: Tools -> Batch record modification Tools -> Batch item modification Tools -> Stage MARC records for import Tools -> Staged MARC record management I did *not* get an alert for the following interfaces: Tools -> Upload local cover image Circulation -> Upload offline circulation data (but I wasn't giving it a real file... if it needs a real-ish file, can you provide a test one that I can manipulate?) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23753 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |nick@bywatersolutions.com Depends on| |19417 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19417 [Bug 19417] Improve display of errors from background job during stage for import -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23753 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Background job JavaScript |Add missing humanMsg |should not try to call |library to pages using |humanMsg library |background job JavaScript Status|Failed QA |ASSIGNED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23753 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #94027|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23753 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|Trivial patch |Small patch Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23753 --- Comment #3 from Owen Leonard <oleonard@myacpl.org> --- Created attachment 99786 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=99786&action=edit 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. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23753 --- Comment #4 from Owen Leonard <oleonard@myacpl.org> --- I changed the title of this bug to reflect the new aim of the patch: To include the humanMsg library on pages which need it (rather than removing it as a dependency). -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23753 Maryse Simard <maryse.simard@inlibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #99786|0 |1 is obsolete| | --- Comment #5 from Maryse Simard <maryse.simard@inlibro.com> --- Created attachment 99790 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=99790&action=edit 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 <maryse.simard@inlibro.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23753 Maryse Simard <maryse.simard@inlibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |maryse.simard@inlibro.com Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23753 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23753 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #99790|0 |1 is obsolete| | --- Comment #6 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 99828 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=99828&action=edit 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 <maryse.simard@inlibro.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23753 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to master Version(s)| |20.05.00 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23753 --- Comment #7 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Nice work everyone! Pushed to master for 20.05 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23753 Joy Nelson <joy@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |joy@bywatersolutions.com Version(s)|20.05.00 |20.05.00, 19.11.05 released in| | Status|Pushed to master |Pushed to stable --- Comment #8 from Joy Nelson <joy@bywatersolutions.com> --- Backported to 19.11.x branch for 19.11.05 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23753 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to stable |Pushed to oldstable CC| |lucas@bywatersolutions.com Version(s)|20.05.00, 19.11.05 |20.05.00, 19.11.05, released in| |19.05.10 --- Comment #9 from Lucas Gass <lucas@bywatersolutions.com> --- backported to 19.05.x for 19.05.10 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23753 Hayley Mapley <hayleymapley@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |hayleymapley@catalyst.net.n | |z --- Comment #10 from Hayley Mapley <hayleymapley@catalyst.net.nz> --- Dependency not in 18.11., not backporting to 18.11.x series -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org