[Bug 27508] New: Can't duplicate the MARC field tag with JavaScript if option "advancedMARCeditor" is set to "Don't display"
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27508 Bug ID: 27508 Summary: Can't duplicate the MARC field tag with JavaScript if option "advancedMARCeditor" is set to "Don't display" Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: ASSIGNED Severity: minor Priority: P5 - low Component: Cataloging Assignee: stalkernoid@gmail.com Reporter: stalkernoid@gmail.com QA Contact: testopia@bugs.koha-community.org CC: m.de.rooy@rijksmuseum.nl, nugged@gmail.com, slavashishkin@gmail.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27508 Peter Vashchuk <stalkernoid@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- 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=27508 --- Comment #1 from Peter Vashchuk <stalkernoid@gmail.com> --- Created attachment 115535 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=115535&action=edit Bug 27508: do nothing if tag label elements don't exist When JavaScript make copy of DOM set for MARC tag, it tries to reassign label elements to another id, the problem is there is no check for existence of that label element, so in case when option "advancedMARCeditor" is set to "Don't display", labels were absent which caused JavaScript to crush in the middle of process with uncaught exception. This patch wraps this label assignment in try/catch hook like it's done in the code around for other elements, to allow the script to proceed when description labels are not present. To test: 1) Check in the system preferences interface subsection that "advancedMARCeditor" is set to "Display". 2) Go to the "Add MARC record" cataloguing section and press "Repeat this tag" button near the MARC tag record to ensure that it makes duplicate in the interface as expected. 3) Then again in the system preferences interface subsection change "advancedMARCeditor" to "Don't display". 4) Return back to the "Add MARC record" interface, refresh the page to have no MARC field labels displayed, and try duplicating the tag again. 5) Ensure that it doesn't work, also you can notice a JavaScript error "Cannot read property "setAttribute" of undefined..." in the JavaScript console of your browser. 6) Apply the patch. 7) Repeat the test sequence (changes will be in the step 5), ensure that the tag gets duplicated even when description labels are not present. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27508 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off Patch complexity|--- |Trivial patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27508 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #115535|0 |1 is obsolete| | --- Comment #2 from Owen Leonard <oleonard@myacpl.org> --- Created attachment 115574 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=115574&action=edit Bug 27508: do nothing if tag label elements don't exist When JavaScript make copy of DOM set for MARC tag, it tries to reassign label elements to another id, the problem is there is no check for existence of that label element, so in case when option "advancedMARCeditor" is set to "Don't display", labels were absent which caused JavaScript to crush in the middle of process with uncaught exception. This patch wraps this label assignment in try/catch hook like it's done in the code around for other elements, to allow the script to proceed when description labels are not present. To test: 1) Check in the system preferences interface subsection that "advancedMARCeditor" is set to "Display". 2) Go to the "Add MARC record" cataloguing section and press "Repeat this tag" button near the MARC tag record to ensure that it makes duplicate in the interface as expected. 3) Then again in the system preferences interface subsection change "advancedMARCeditor" to "Don't display". 4) Return back to the "Add MARC record" interface, refresh the page to have no MARC field labels displayed, and try duplicating the tag again. 5) Ensure that it doesn't work, also you can notice a JavaScript error "Cannot read property "setAttribute" of undefined..." in the JavaScript console of your browser. 6) Apply the patch. 7) Repeat the test sequence (changes will be in the step 5), ensure that the tag gets duplicated even when description labels are not present. Signed-off-by: Owen Leonard <oleonard@myacpl.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27508 Joonas Kylmälä <joonas.kylmala@helsinki.fi> 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=27508 Joonas Kylmälä <joonas.kylmala@helsinki.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #115574|0 |1 is obsolete| | --- Comment #3 from Joonas Kylmälä <joonas.kylmala@helsinki.fi> --- Created attachment 115739 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=115739&action=edit Bug 27508: do nothing if tag label elements don't exist When JavaScript make copy of DOM set for MARC tag, it tries to reassign label elements to another id, the problem is there is no check for existence of that label element, so in case when option "advancedMARCeditor" is set to "Don't display", labels were absent which caused JavaScript to crush in the middle of process with uncaught exception. This patch wraps this label assignment in try/catch hook like it's done in the code around for other elements, to allow the script to proceed when description labels are not present. To test: 1) Check in the system preferences interface subsection that "advancedMARCeditor" is set to "Display". 2) Go to the "Add MARC record" cataloguing section and press "Repeat this tag" button near the MARC tag record to ensure that it makes duplicate in the interface as expected. 3) Then again in the system preferences interface subsection change "advancedMARCeditor" to "Don't display". 4) Return back to the "Add MARC record" interface, refresh the page to have no MARC field labels displayed, and try duplicating the tag again. 5) Ensure that it doesn't work, also you can notice a JavaScript error "Cannot read property "setAttribute" of undefined..." in the JavaScript console of your browser. 6) Apply the patch. 7) Repeat the test sequence (changes will be in the step 5), ensure that the tag gets duplicated even when description labels are not present. Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27508 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to master Version(s)| |21.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=27508 --- Comment #4 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Pushed to master for 21.05, 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=27508 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to master |Pushed to stable CC| |fridolin.somers@biblibre.co | |m Version(s)|21.05.00 |21.05.00,20.11.03 released in| | --- Comment #5 from Fridolin Somers <fridolin.somers@biblibre.com> --- Pushed to 20.11.x for 20.11.03 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27508 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |andrew@bywatersolutions.com Resolution|--- |FIXED Status|Pushed to stable |RESOLVED --- Comment #6 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Cannot recreate error on 20.05. Not backporting. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27508 Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |caroline.cyr-la-rose@inlibr | |o.com -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org