<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:DengXian;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:"\@DengXian";
        panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
p.gmail-m-3011596237024127907msolistparagraph, li.gmail-m-3011596237024127907msolistparagraph, div.gmail-m-3011596237024127907msolistparagraph
        {mso-style-name:gmail-m_-3011596237024127907msolistparagraph;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:145442357;
        mso-list-template-ids:1268442470;}
ol
        {margin-bottom:0cm;}
ul
        {margin-bottom:0cm;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-AU link=blue vlink=purple><div class=WordSection1><p class=MsoNormal>Thanks for replying so quickly, Jonathan. <o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Based on <a href="https://www.w3schools.com/Bootstrap/bootstrap_ref_js_modal.asp">https://www.w3schools.com/Bootstrap/bootstrap_ref_js_modal.asp</a>, I’d say that it should actually be a CSS ID selector. In this case #loginModal. This makes sense because when I was debugging the Jquery, it was failing to use “/cgi-bin/koha/opac-user.pl” as a selector for creating a Jquery object. Looks like Bootstrap is cheating by requiring using a href attribute to store a CSS ID selector…<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I’ll write up a patch for this and see how I go.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>For what it’s worth, I don’t think using href=”#” would work because it’s not a valid CSS selector. I think you’d get something like this instead (which I’ve been getting in a 19.11 instance with some custom HTML in the OPAC system preferences although admittedly I haven’t 100% determined its cause either):<o:p></o:p></p><p class=MsoNormal>jquery-3.4.1.min.js?date=08032016:formatted:546 Uncaught Error: Syntax error, unrecognized expression: #<o:p></o:p></p><p class=MsoNormal>    at Function.se.error (jquery-3.4.1.min.js?date=08032016:formatted:546)<o:p></o:p></p><p class=MsoNormal>    at se.tokenize (jquery-3.4.1.min.js?date=08032016:formatted:969)<o:p></o:p></p><p class=MsoNormal>    at se.select (jquery-3.4.1.min.js?date=08032016:formatted:1024)<o:p></o:p></p><p class=MsoNormal>    at Function.se [as find] (jquery-3.4.1.min.js?date=08032016:formatted:289)<o:p></o:p></p><p class=MsoNormal>    at k.fn.init.find (jquery-3.4.1.min.js?date=08032016:formatted:1138)<o:p></o:p></p><p class=MsoNormal>    at new k.fn.init (jquery-3.4.1.min.js?date=08032016:formatted:1159)<o:p></o:p></p><p class=MsoNormal>    at k (jquery-3.4.1.min.js?date=08032016:formatted:50)<o:p></o:p></p><p class=MsoNormal>    at i (bootstrap.min.js?date=08032016:6)<o:p></o:p></p><p class=MsoNormal>    at HTMLAnchorElement.<anonymous> (bootstrap.min.js?date=08032016:6)<o:p></o:p></p><p class=MsoNormal>    at Function.each (jquery-3.4.1.min.js?date=08032016:formatted:146)<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>But… we didn’t follow <a href="https://www.w3schools.com/Bootstrap/bootstrap_ref_js_modal.asp">https://www.w3schools.com/Bootstrap/bootstrap_ref_js_modal.asp</a> in previous versions of Koha, so I’m wondering why things didn’t bust previously. <o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Debugging the Bootstrap JS…. In 17.05 the Jquery object instantiation was using “init” and 19.11 it uses “s.fn.init” which appears to be provided by jquery-migrate-3.1.0. In 17.05, the function that dies in 19.11 succeeds… and it looks like it’s using “/cgi-bin/koha/opac-user.pl” as a selector… which was invalid but it didn’t die. It just returned nothing.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Ahhh so the Bootstrap handling would fail, and then eventually the a.loginModal-trigger click handler that we define in script.js runs and does the work. <o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>So it seems to me we were probably using Bootstrap incorrectly before 19.11 but it didn’t matter because it didn’t throw an error and we worked around it. <o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Ok, I’m going to write up a patch and see how I go…<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Thanks, Jonathan ^_^. This was driving me a bit crazy last night heh.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>David Cook<o:p></o:p></p><p class=MsoNormal>Systems Librarian<o:p></o:p></p><p class=MsoNormal>Prosentient Systems<o:p></o:p></p><p class=MsoNormal>72/330 Wattle St<o:p></o:p></p><p class=MsoNormal>Ultimo, NSW 2007<o:p></o:p></p><p class=MsoNormal>Australia<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Office: 02 9212 0899<o:p></o:p></p><p class=MsoNormal>Direct: 02 8005 0595<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><b><span lang=EN-US>From:</span></b><span lang=EN-US> Jonathan Druart <jonathan.druart@bugs.koha-community.org> <br><b>Sent:</b> Wednesday, 4 March 2020 8:34 PM<br><b>To:</b> David Cook <dcook@prosentient.com.au><br><b>Cc:</b> koha-devel <koha-devel@lists.koha-community.org><br><b>Subject:</b> Re: [Koha-devel] Javascript errors in OPAC<o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p><div><div><p class=MsoNormal>href is supposed to be an anchor, but it's an url<o:p></o:p></p></div><div><p class=MsoNormal><a href="https://www.w3schools.com/Bootstrap/bootstrap_ref_js_modal.asp">https://www.w3schools.com/Bootstrap/bootstrap_ref_js_modal.asp</a><o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Caused by<o:p></o:p></p></div><div><p class=MsoNormal>  commit 8b1fb387acee35ba64f61d59fd332a79<br>  Bug 14862: Upgrade jQuery from 1.7 to 3.4.1 in OPAC<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>We should replace the href="/cgi-bin/koha/<a href="http://opac-user.pl">opac-user.pl</a>" with href="#". But I first glance I'd say that the open id connect stuff is broken.<o:p></o:p></p></div></div><p class=MsoNormal><o:p> </o:p></p><div><div><p class=MsoNormal>Le mer. 4 mars 2020 à 09:36, <<a href="mailto:dcook@prosentient.com.au">dcook@prosentient.com.au</a>> a écrit :<o:p></o:p></p></div><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm'><div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Hi all (and especially Owen),<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>I’m noticing some odd Javascript errors in the OPAC in 19.11 and master. <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Steps to reproduce:<o:p></o:p></p><ol start=1 type=1><li class=gmail-m-3011596237024127907msolistparagraph style='mso-list:l0 level1 lfo1'>Go to the OPAC and open the F12 dev tools. <o:p></o:p></li><li class=gmail-m-3011596237024127907msolistparagraph style='mso-list:l0 level1 lfo1'>Click on “Log in to your account”<o:p></o:p></li><li class=gmail-m-3011596237024127907msolistparagraph style='mso-list:l0 level1 lfo1'>Note the following in your console logs<o:p></o:p></li></ol><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>jquery-3.4.1.min_19.1200030.js:2 Uncaught Error: Syntax error, unrecognized expression: /cgi-bin/koha/<a href="http://opac-user.pl" target="_blank">opac-user.pl</a><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>    at Function.se.error (jquery-3.4.1.min_19.1200030.js:2)<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>    at se.tokenize (jquery-3.4.1.min_19.1200030.js:2)<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>    at se.select (jquery-3.4.1.min_19.1200030.js:2)<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>    at Function.se (jquery-3.4.1.min_19.1200030.js:2)<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>    at Function.s.find (jquery-migrate-3.1.0.min_19.1200030.js:2)<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>    at k.fn.init.find (jquery-3.4.1.min_19.1200030.js:2)<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>    at s.fn.init.k.fn.init (jquery-3.4.1.min_19.1200030.js:2)<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>    at new s.fn.init (jquery-migrate-3.1.0.min_19.1200030.js:2)<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>    at k (jquery-3.4.1.min_19.1200030.js:2)<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-indent:9.75pt'>at HTMLAnchorElement.<anonymous> (bootstrap.min_19.1200030.js:6)<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Using the Chrome tools, I was able to pretty print the Javascript, so now I see the following:<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Uncaught Error: Syntax error, unrecognized expression: /cgi-bin/koha/<a href="http://opac-user.pl" target="_blank">opac-user.pl</a><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>    at Function.se.error (jquery-3.4.1.min_19.1200030.js:formatted:546)<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>    at se.tokenize (jquery-3.4.1.min_19.1200030.js:formatted:969)<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>    at se.select (jquery-3.4.1.min_19.1200030.js:formatted:1024)<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>    at Function.se (jquery-3.4.1.min_19.1200030.js:formatted:289)<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>    at Function.s.find (jquery-migrate-3.1.0.min_19.1200030.js:2)<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>    at k.fn.init.find (jquery-3.4.1.min_19.1200030.js:formatted:1138)<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>    at s.fn.init.k.fn.init (jquery-3.4.1.min_19.1200030.js:formatted:1159)<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>    at new s.fn.init (jquery-migrate-3.1.0.min_19.1200030.js:2)<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>    at k (jquery-3.4.1.min_19.1200030.js:formatted:50)<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-indent:9.75pt'>at HTMLAnchorElement.<anonymous> (bootstrap.min_19.1200030.js:formatted:535)<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-indent:9.75pt'> <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>It kind of looks to me like some sort of incompatibility between Bootstrap 2.3.1 and Jquery 3.4.1?<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>I’ve put breakpoints up and down this code but it’s not jumping out at me exactly what’s happening except that maybe it’s trying to use the href attribute as a selector and it’s not working… but why it would even try in the first place confuses me. It looks like a Bootstrap-level thing, which is why I’m thinking maybe older versions of Jquery worked a bit differently? <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Anyway I’ve already stayed way too late at work today. Maybe someone smarter than me can figure this one out.<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>David Cook<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Systems Librarian<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Prosentient Systems<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>72/330 Wattle St<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Ultimo, NSW 2007<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Australia<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Office: 02 9212 0899<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Direct: 02 8005 0595<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p></div></div><p class=MsoNormal>_______________________________________________<br>Koha-devel mailing list<br><a href="mailto:Koha-devel@lists.koha-community.org" target="_blank">Koha-devel@lists.koha-community.org</a><br><a href="https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel" target="_blank">https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel</a><br>website : <a href="http://www.koha-community.org/" target="_blank">http://www.koha-community.org/</a><br>git : <a href="http://git.koha-community.org/" target="_blank">http://git.koha-community.org/</a><br>bugs : <a href="http://bugs.koha-community.org/" target="_blank">http://bugs.koha-community.org/</a><o:p></o:p></p></blockquote></div></div></body></html>