[Bug 24803] New: Clicking "Log in to your account" throws fatal Javascript error
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24803 Bug ID: 24803 Summary: Clicking "Log in to your account" throws fatal Javascript error Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: blocker Priority: P5 - low Component: OPAC Assignee: oleonard@myacpl.org Reporter: dcook@prosentient.com.au QA Contact: testopia@bugs.koha-community.org Clicking "Log in to your account" throws a fatal Javascript error, because the link has a href of "/cgi-bin/koha/opac-user.pl" and Bootstrap passes the href to Jquery as if it were a CSS ID selector. In the past, Jquery didn't throw a fatal error for this mistake, so it was fine. But now Jquery appears to be stricter with the upgrade to 3.4.1. This error causes Javascript to fail and could lead to unexpected behaviour. (I have an idea for a patch that I'll be trying out very soon.) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24803 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|oleonard@myacpl.org |dcook@prosentient.com.au -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24803 --- Comment #1 from David Cook <dcook@prosentient.com.au> --- My first idea is to replace "/cgi-bin/koha/opac-user.pl" with #loginModal (as per https://www.w3schools.com/Bootstrap/bootstrap_ref_js_modal.asp), and that works (after disabling our Koha click handler for showing/hiding the modal). But... now I'm wondering if we had the "href" as "/cgi-bin/koha/opac-user.pl" for a reason. Maybe so the link would still work if Javascript wasn't working? So I'm going to work on an alternative idea suggested by Jonathan too... -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24803 --- Comment #2 from David Cook <dcook@prosentient.com.au> --- (In reply to David Cook from comment #1)
So I'm going to work on an alternative idea suggested by Jonathan too...
Oh except the alternative idea won't retain a usable link either... well I might provide it anyway, and let the community decide which they prefer. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24803 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- 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=24803 --- Comment #3 from David Cook <dcook@prosentient.com.au> --- Created attachment 100156 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=100156&action=edit Bug 24803: Remove JS error by following Bootstrap instructions This patch patches #lodinModal to Bootstrap's click.modal.data-api event handler for the '[data-toggle="modal"] selector, so Bootstrap can handle the hide/show behaviour of the login modal. Test plan: 1. Apply patch 2. Open F12 dev tools 3. Click "Log in to your account" on OPAC 4. Observe no Javascript errors in console -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24803 --- Comment #4 from David Cook <dcook@prosentient.com.au> --- Created attachment 100157 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=100157&action=edit Bug 24803: [Alternate patch] bypass Bootstrap click handler by using "#" This patch bypasses Bootstrap's click.modal.data-api event handler for the '[data-toggle="modal"] selector by using a "#" as the "href" Test plan: 1. Apply patch 2. Open F12 dev tools 3. Click "Log in to your account" on OPAC 4. Observe no Javascript errors in console -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24803 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@bugs.koha-c | |ommunity.org -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24803 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |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=24803 Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #100156|0 |1 is obsolete| | --- Comment #5 from Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> --- Created attachment 100159 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=100159&action=edit Bug 24803: Remove JS error by following Bootstrap instructions This patch patches #lodinModal to Bootstrap's click.modal.data-api event handler for the '[data-toggle="modal"] selector, so Bootstrap can handle the hide/show behaviour of the login modal. Test plan: 1. Apply patch 2. Open F12 dev tools 3. Click "Log in to your account" on OPAC 4. Observe no Javascript errors in console Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> JS error verified, and corrected. No qa errors. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24803 Bernardo Gonzalez Kriegel <bgkriegel@gmail.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=24803 Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #100157|0 |1 is obsolete| | --- Comment #6 from Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> --- Created attachment 100160 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=100160&action=edit Bug 24803: [Alternate patch] bypass Bootstrap click handler by using "#" This patch bypasses Bootstrap's click.modal.data-api event handler for the '[data-toggle="modal"] selector by using a "#" as the "href" Test plan: 1. Apply patch 2. Open F12 dev tools 3. Click "Log in to your account" on OPAC 4. Observe no Javascript errors in console Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> JS error verified, and corrected. No qa errors. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24803 Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |bgkriegel@gmail.com --- Comment #7 from Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> --- (In reply to David Cook from comment #2)
(In reply to David Cook from comment #1)
So I'm going to work on an alternative idea suggested by Jonathan too...
Oh except the alternative idea won't retain a usable link either... well I might provide it anyway, and let the community decide which they prefer.
Both works :) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24803 --- Comment #8 from David Cook <dcook@prosentient.com.au> --- Thanks, Bernardo! I'm curious to see what QA and RM think about the best approach. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24803 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- 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=24803 --- Comment #9 from Owen Leonard <oleonard@myacpl.org> --- Created attachment 100191 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=100191&action=edit Bug 24803: [Alternate] Clicking "Log in to your account" throws fatal Javascript error This patch removes the "data-toggle" attribute from the login link in order to avoid a JavaScript error. Since we have a custom click handler to trigger the modal we don't need Bootstrap's "automatic" modal handling. Test plan: 1. Apply patch 2. Open F12 dev tools 3. Click "Log in to your account" on OPAC 4. Observe no Javascript errors in console -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24803 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #100191|0 |1 is obsolete| | --- Comment #10 from David Cook <dcook@prosentient.com.au> --- Created attachment 100208 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=100208&action=edit Bug 24803: [Alternate] Clicking "Log in to your account" throws fatal Javascript error This patch removes the "data-toggle" attribute from the login link in order to avoid a JavaScript error. Since we have a custom click handler to trigger the modal we don't need Bootstrap's "automatic" modal handling. Test plan: 1. Apply patch 2. Open F12 dev tools 3. Click "Log in to your account" on OPAC 4. Observe no Javascript errors in console Signed-off-by: David Cook <dcook@prosentient.com.au> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24803 --- Comment #11 from David Cook <dcook@prosentient.com.au> --- Nice one, Owen. I think I prefer Owen's patch best, since it keeps a usable link. But will leave it up to QA/RM. (Also, as Jonathan noted on koha-devel, GoogleOpenIDConnect will be affected by the same issue, so whatever approach we choose here should be applied there as well.) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24803 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> 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=24803 --- Comment #12 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 100209 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=100209&action=edit Bug 24803: [PASSED_QA] Clicking "Log in to your account" throws fatal Javascript error This patch removes the "data-toggle" attribute from the login link in order to avoid a JavaScript error. Since we have a custom click handler to trigger the modal we don't need Bootstrap's "automatic" modal handling. Test plan: 1. Apply patch 2. Open F12 dev tools 3. Click "Log in to your account" on OPAC 4. Observe no Javascript errors in console Signed-off-by: David Cook <dcook@prosentient.com.au> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24803 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |m.de.rooy@rijksmuseum.nl Attachment #100208|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=24803 --- Comment #13 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- RM: I prefer Owen's patch too, marked as PASSED_QA. If you agree, obsolete the other two. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24803 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |m.de.rooy@rijksmuseum.nl |y.org | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24803 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #100159|0 |1 is obsolete| | Attachment #100160|0 |1 is obsolete| | Attachment #100209|0 |1 is obsolete| | --- Comment #14 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 100217 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=100217&action=edit Bug 24803: Remove JS error when clicking "Log in to your account" This patch removes the "data-toggle" attribute from the login link in order to avoid a JavaScript error. Since we have a custom click handler to trigger the modal we don't need Bootstrap's "automatic" modal handling. Test plan: 1. Apply patch 2. Open F12 dev tools 3. Click "Log in to your account" on OPAC 4. Observe no Javascript errors in console Signed-off-by: David Cook <dcook@prosentient.com.au> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24803 --- Comment #15 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to Marcel de Rooy from comment #13)
RM: I prefer Owen's patch too, marked as PASSED_QA. If you agree, obsolete the other two.
I am not RM, but everybody prefers Owen's patch ;) I planned to QA those patches this morning, done! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24803 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=24803 --- Comment #16 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=24803 Joy Nelson <joy@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to master |Pushed to stable Version(s)|20.05.00 |20.05.00, 19.11.05 released in| | CC| |joy@bywatersolutions.com --- Comment #17 from Joy Nelson <joy@bywatersolutions.com> --- Backported to 19.11.x 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=24803 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lucas@bywatersolutions.com --- Comment #18 from Lucas Gass <lucas@bywatersolutions.com> --- cannot recreate in 19.05.x, no backport -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org