[Bug 28423] New: JavaScript error on MARC modifications page
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28423 Bug ID: 28423 Summary: JavaScript error on MARC modifications page Change sponsored?: --- Product: Koha Version: master Hardware: All URL: /cgi-bin/koha/tools/marc_modification_templates.pl OS: All Status: ASSIGNED Severity: minor Priority: P5 - low Component: Templates Assignee: oleonard@myacpl.org Reporter: oleonard@myacpl.org QA Contact: testopia@bugs.koha-community.org This line in the MARC modification template is problematic because if "ActionsLoop" doesn't exist it creates a JS error. var mmtas = [% ActionsLoop.json | $raw %] Normally the solution would be to wrap the variable in quotes: var mmtas = "[% ActionsLoop.json | $raw %]"; ...but that causes an error if ActionsLoop *is* defined. We need some logic for determining how the script is generated. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28423 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Trivial 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=28423 --- Comment #1 from Owen Leonard <oleonard@myacpl.org> --- Created attachment 121280 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=121280&action=edit Bug 28423: JavaScript error on MARC modifications page This patch makes a minor change to the MARC modifications template so that the "mmtas" variable isn't defined if there is no JSON to be assigned as its value. To test, apply the patch and go to Administration -> MARC modification templates. - If necessary, add a template with at least one action. - Check the browser console, there should be no errors. - Click the "Edit" button corresponding to one of the template actions. - The details of the action should load correctly in the edit form and there should be no errors in the console. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28423 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |28418 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28418 [Bug 28418] Show template_id of MARC modification templates -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28423 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- 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=28423 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #121280|0 |1 is obsolete| | --- Comment #2 from David Nind <david@davidnind.com> --- Created attachment 121303 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=121303&action=edit Bug 28423: JavaScript error on MARC modifications page This patch makes a minor change to the MARC modifications template so that the "mmtas" variable isn't defined if there is no JSON to be assigned as its value. To test, apply the patch and go to Administration -> MARC modification templates. - If necessary, add a template with at least one action. - Check the browser console, there should be no errors. - Click the "Edit" button corresponding to one of the template actions. - The details of the action should load correctly in the edit form and there should be no errors in the console. Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28423 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |david@davidnind.com --- Comment #3 from David Nind <david@davidnind.com> --- Testing notes (koha-testing-docker): - Error message in the browser console when going to Staff interface home > Tools > Catalog > MARC modification templates before applying the patch was: "Uncaught SyntaxError: expected expression, got end of script" - Adding and editing new templates worked as expected - After applying the patch there was no console error -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28423 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=28423 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #121303|0 |1 is obsolete| | --- Comment #4 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 121327 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=121327&action=edit Bug 28423: JavaScript error on MARC modifications page This patch makes a minor change to the MARC modifications template so that the "mmtas" variable isn't defined if there is no JSON to be assigned as its value. To test, apply the patch and go to Administration -> MARC modification templates. - If necessary, add a template with at least one action. - Check the browser console, there should be no errors. - Click the "Edit" button corresponding to one of the template actions. - The details of the action should load correctly in the edit form and there should be no errors in the console. Signed-off-by: David Nind <david@davidnind.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=28423 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |21.11.00 released in| | Status|Passed QA |Pushed to master -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28423 --- Comment #5 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Pushed to master for 21.11, thanks to everybody involved! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28423 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the| |This patch makes a minor release notes| |change to the MARC | |modifications template | |(Staff interface > | |Administration > MARC | |modification templates) so | |that the "mmtas" variable | |isn't defined if there is | |no JSON to be assigned as | |its value. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28423 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|21.11.00 |21.11.00,21.05.02 released in| | Status|Pushed to master |Pushed to stable CC| |kyle@bywatersolutions.com --- Comment #6 from Kyle M Hall <kyle@bywatersolutions.com> --- Pushed to 21.05.x for 21.05.02 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28423 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|21.11.00,21.05.02 |21.11.00,21.05.02,20.11.08 released in| | Status|Pushed to stable |Pushed to oldstable CC| |fridolin.somers@biblibre.co | |m --- Comment #7 from Fridolin Somers <fridolin.somers@biblibre.com> --- Pushed to 20.11.x for 20.11.08 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28423 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to oldstable |RESOLVED Resolution|--- |FIXED CC| |victor@tuxayo.net --- Comment #8 from Victor Grousset/tuxayo <victor@tuxayo.net> --- Not backported to oldoldstable (20.05.x). Feel free to ask if it's needed. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org