[Bug 30689] New: Incorrect Babeltheque setting can cause console warning
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30689 Bug ID: 30689 Summary: Incorrect Babeltheque setting can cause console warning Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: ASSIGNED Severity: trivial Priority: P5 - low Component: OPAC Assignee: oleonard@myacpl.org Reporter: oleonard@myacpl.org QA Contact: testopia@bugs.koha-community.org If you have the "Babeltheque" system preference enabled but the "Babeltheque_url_js" preference is empty, the template will generate an empty <script> tag. This triggers a warning in the browser console. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30689 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=30689 --- Comment #1 from Owen Leonard <oleonard@myacpl.org> --- Created attachment 134635 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=134635&action=edit Bug 30689: Incorrect Babeltheque setting can cause console warning This patch adds an additional system preference check to the part of the OPAC bibliographic detail template which conditionally loads Babelthèque JavaScript. The script tag should not be output if there is no Babeltheque_url_js setting to use. To test, apply the patch and search for "Babeltheque" in system preferences. - Set "Babeltheque" to "Do" include information. - Enter a path in the "Babeltheque_url_js" preference, e.g. "https://www.example.com/example.js" It doesn't have to be a valid Babeltheque URL. - In the OPAC, view the bibliographic detail page for any title. If you used a dummy URL for the js preference you should see an error in the console about the file not being found. This confirms that the template logic is working. If you used a working Babeltheque URL then the corresponding content should load. - Return to system preferences and remove the URL from the "Babeltheque_url_js" preference. - Return to the bibliographic detail page in the OPAC and confirm that there is no warning in the console about "'src' attribute of <script> element is empty." -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30689 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=30689 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #134635|0 |1 is obsolete| | --- Comment #2 from David Nind <david@davidnind.com> --- Created attachment 134773 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=134773&action=edit Bug 30689: Incorrect Babeltheque setting can cause console warning This patch adds an additional system preference check to the part of the OPAC bibliographic detail template which conditionally loads Babelthèque JavaScript. The script tag should not be output if there is no Babeltheque_url_js setting to use. To test, apply the patch and search for "Babeltheque" in system preferences. - Set "Babeltheque" to "Do" include information. - Enter a path in the "Babeltheque_url_js" preference, e.g. "https://www.example.com/example.js" It doesn't have to be a valid Babeltheque URL. - In the OPAC, view the bibliographic detail page for any title. If you used a dummy URL for the js preference you should see an error in the console about the file not being found. This confirms that the template logic is working. If you used a working Babeltheque URL then the corresponding content should load. - Return to system preferences and remove the URL from the "Babeltheque_url_js" preference. - Return to the bibliographic detail page in the OPAC and confirm that there is no warning in the console about "'src' attribute of <script> element is empty." 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=30689 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): - Warning message in browser console before patch applied: ‘src’ attribute of <script> element is empty. - There was then an empty script tag in the browser source file for the page: <script src=" "></script> - This was just after this text in the browser source file: <div class="babeltheque_adds"> <div id="BW_critiques_aj"></div> <div id="BW_citations_aj"></div> </div> - When patch applied, these were the console error messages: . GET https://www.example.com/example.js [HTTP/2 404 Not Found 1554ms] . Loading failed for the <script> with source “https://www.example.com/example.js”. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30689 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=30689 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #134773|0 |1 is obsolete| | --- Comment #4 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 134944 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=134944&action=edit Bug 30689: Incorrect Babeltheque setting can cause console warning This patch adds an additional system preference check to the part of the OPAC bibliographic detail template which conditionally loads Babelthèque JavaScript. The script tag should not be output if there is no Babeltheque_url_js setting to use. To test, apply the patch and search for "Babeltheque" in system preferences. - Set "Babeltheque" to "Do" include information. - Enter a path in the "Babeltheque_url_js" preference, e.g. "https://www.example.com/example.js" It doesn't have to be a valid Babeltheque URL. - In the OPAC, view the bibliographic detail page for any title. If you used a dummy URL for the js preference you should see an error in the console about the file not being found. This confirms that the template logic is working. If you used a working Babeltheque URL then the corresponding content should load. - Return to system preferences and remove the URL from the "Babeltheque_url_js" preference. - Return to the bibliographic detail page in the OPAC and confirm that there is no warning in the console about "'src' attribute of <script> element is empty." Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30689 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to master Version(s)| |22.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=30689 --- Comment #5 from Fridolin Somers <fridolin.somers@biblibre.com> --- Pushed to master for 22.05, thanks to everybody involved 🦄 -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org