[Bug 31217] New: Fix Coce JavaScript to hide single-pixel cover images in the OPAC lightbox gallery
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31217 Bug ID: 31217 Summary: Fix Coce JavaScript to hide single-pixel cover images in the OPAC lightbox gallery Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: OPAC Assignee: oleonard@myacpl.org Reporter: alexbuckley@catalyst.net.nz QA Contact: testopia@bugs.koha-community.org The shift to using a lightbox gallery to display cover images in the detail pages of the OPAC has stopped Coce from hiding 1-pixel cover images. This line ( https://github.com/Koha-Community/Koha/blob/0177b88eb33d398da4eb5ffb63442269... ) should hide the coce-coverimg box from the OPAC for 1-pixel images. However, coce-coverimg is an id, not a class, in the OPAC detail page, therefore, this JavaScript does not hide anything in the OPAC. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31217 --- Comment #1 from Alex Buckley <alexbuckley@catalyst.net.nz> --- Created attachment 137995 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=137995&action=edit Bug 31217: OPAC coce.js is not hiding the coce-coverimg div for single-pixel images This is because OPAC coce.js targets coce-coverimg as a class, when it is actually an ID. Test plan: 1. Set: - CoceHost = https://coce.mykoha.co.nz - CoceProviders = Select all - OpacCoce = Enable 2. Add the ISBN of '9780262336499' to a biblio 3. View the biblio in the OPAC. Observe an empty 'Coce image from Amazon.com' box loads 4. Apply patch and restart services 5. Reload the same biblio record in the OPAC. Observe the empty 'Coce image from Amazon.com' is not displayed Sponsored-by: Toi Ohomai Institute of Technology, New Zealand -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31217 Alex Buckley <alexbuckley@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|oleonard@myacpl.org |alexbuckley@catalyst.net.nz Change sponsored?|--- |Sponsored Status|NEW |Needs Signoff Depends on| |28180 Patch complexity|--- |Trivial patch Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28180 [Bug 28180] Use a lightbox gallery to display the images on the detail pages in OPAC -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31217 --- Comment #2 from Alex Buckley <alexbuckley@catalyst.net.nz> --- This is now ready for testing! This is the coce-coverimg in opac-detail.tt ( https://github.com/Koha-Community/Koha/blob/0177b88eb33d398da4eb5ffb63442269... ) as you can see it is an id, not a class. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31217 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart+koha@gmail. | |com --- Comment #3 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Hi Alex, I didn't test the patch, bug had a look at it. A couple of remarks: 1. if you have the id you don't need to use a parent, the line could simply be $("#coce-coverimg").remove(); 2. I am wondering if staff-side as well: koha-tmpl/intranet-tmpl/js/coce.js: $(this).closest(".coce-coverimg").remove(); We are using an id on the detail page koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt: <div class="cover-image" id="coce-coverimg"> BUT a class on the result list koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt: <div id="coce-coverimg-[% SEARCH_RESULT.biblionumber | html %]" class="cover-image coce-coverimg"> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31217 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |david@davidnind.com --- Comment #4 from David Nind <david@davidnind.com> --- I was able to successfully test this in an "Ingognito" window using Google Chrome: - without the patch, it displays a spinner and 'Coce image from Amazon' - after the patch (and clearing the cached and restarting), no image was displayed For whatever reason (probably privacy and other settings) I didn't observe the same in Firefox - no image or placeholder was displayed in the OAPC details page. Happy to sign off once Jonathan's question(s) are resolved. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31217 Alex Buckley <alexbuckley@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #137995|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=31217 --- Comment #5 from Alex Buckley <alexbuckley@catalyst.net.nz> --- Created attachment 138070 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=138070&action=edit Bug 31217: OPAC coce.js is not hiding the coce-coverimg div for single-pixel images This is because OPAC coce.js targets coce-coverimg as a class, when it is actually an ID. Test plan: 1. Set: - CoceHost = https://coce.mykoha.co.nz - CoceProviders = Select all - OpacCoce = Enable 2. Add the ISBN of '9780262336499' to a biblio 3. Open a "Incognito" window in your browser (recommended to use Google Chrome to test this) 4. View the biblio in the OPAC. Observe a 'Coce image from Amazon' box loads with a spinner 5. Apply patch and restart services 6. Clear your browser cache 7. Reload the same biblio record in the OPAC. Observe no image is displayed. Sponsored-by: Toi Ohomai Institute of Technology, New Zealand -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31217 --- Comment #6 from Alex Buckley <alexbuckley@catalyst.net.nz> --- Hi Jonathan and David, Thank you both very much for your input. I have done the following: - Changed my patch to '$("#coce-coverimg").remove();' - Created a new bug report for making a similar change on the staff-side (bug 31228) - Amended my commit test plan based on your notes David. Ready to test again! Alex -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31217 Alex Buckley <alexbuckley@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=31228 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31217 Alex Buckley <alexbuckley@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #138070|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=31217 --- Comment #7 from Alex Buckley <alexbuckley@catalyst.net.nz> --- Created attachment 138111 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=138111&action=edit Bug 31217: OPAC coce.js is not hiding the coce-coverimg div for single-pixel images This is because opac-detail.tt has coce-coverimg as an ID, but OPAC coce.js targets coce-coverimg as a class. opac-detail.tt should be changed to have coce-coverimg as a class. Test plan: 1. Set your system preferences: - CoceHost = https://coce.mykoha.co.nz - CoceProviders = Select all - OpacCoce = Enable 2. Add the ISBN of '9780262336499' to a biblio 3. Open a "Incognito" window in your browser (recommended to use Google Chrome to test this) 4. View the biblio detail page in the OPAC. Observe a 'Coce image from Amazon' box loads with a spinner 5. Apply patch and restart services 6. Clear your browser cache 7. Reload the same biblio detail page in the OPAC. Observe no image is displayed. 8. View another OPAC biblio detail page that does have a successfully loading coce image and confirm the source of that image is listed: For example 'Coce image from Amazon.com' is displayed Sponsored-by: Toi Ohomai Institute of Technology, New Zealand -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31217 --- Comment #8 from Alex Buckley <alexbuckley@catalyst.net.nz> --- I've gone ahead and added patches on this bug report and 31228 to switch to using coce-coverimg as a class consistently in the OPAC and staff client. I have found that browser caching can make this a tricky thing to test. Ready for testing again. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31217 Paul Derscheid <paul.derscheid@lmscloud.de> 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=31217 Paul Derscheid <paul.derscheid@lmscloud.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #138111|0 |1 is obsolete| | --- Comment #9 from Paul Derscheid <paul.derscheid@lmscloud.de> --- Created attachment 138192 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=138192&action=edit Bug 31217: OPAC coce.js is not hiding the coce-coverimg div for single-pixel images This is because opac-detail.tt has coce-coverimg as an ID, but OPAC coce.js targets coce-coverimg as a class. opac-detail.tt should be changed to have coce-coverimg as a class. Test plan: 1. Set your system preferences: - CoceHost = https://coce.mykoha.co.nz - CoceProviders = Select all - OpacCoce = Enable 2. Add the ISBN of '9780262336499' to a biblio 3. Open a "Incognito" window in your browser (recommended to use Google Chrome to test this) 4. View the biblio detail page in the OPAC. Observe a 'Coce image from Amazon' box loads with a spinner 5. Apply patch and restart services 6. Clear your browser cache 7. Reload the same biblio detail page in the OPAC. Observe no image is displayed. 8. View another OPAC biblio detail page that does have a successfully loading coce image and confirm the source of that image is listed: For example 'Coce image from Amazon.com' is displayed Sponsored-by: Toi Ohomai Institute of Technology, New Zealand Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31217 Paul Derscheid <paul.derscheid@lmscloud.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |paul.derscheid@lmscloud.de --- Comment #10 from Paul Derscheid <paul.derscheid@lmscloud.de> --- Didn't write it in the sign-off because I'm scared of the python timeouts but everything works as expected. Great work. 👍 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31217 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #138192|0 |1 is obsolete| | --- Comment #11 from Owen Leonard <oleonard@myacpl.org> --- Created attachment 138198 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=138198&action=edit Bug 31217: OPAC coce.js is not hiding the coce-coverimg div for single-pixel images This is because opac-detail.tt has coce-coverimg as an ID, but OPAC coce.js targets coce-coverimg as a class. opac-detail.tt should be changed to have coce-coverimg as a class. Test plan: 1. Set your system preferences: - CoceHost = https://coce.mykoha.co.nz - CoceProviders = Select all - OpacCoce = Enable 2. Add the ISBN of '9780262336499' to a biblio 3. Open a "Incognito" window in your browser (recommended to use Google Chrome to test this) 4. View the biblio detail page in the OPAC. Observe a 'Coce image from Amazon' box loads with a spinner 5. Apply patch and restart services 6. Clear your browser cache 7. Reload the same biblio detail page in the OPAC. Observe no image is displayed. 8. View another OPAC biblio detail page that does have a successfully loading coce image and confirm the source of that image is listed: For example 'Coce image from Amazon.com' is displayed Sponsored-by: Toi Ohomai Institute of Technology, New Zealand Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> 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=31217 --- Comment #12 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- I believe that this should work, but I have trouble testing. I can see the cover in the OPAC result list, but the detail pages all remain empty, with and without the patch :( -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31217 --- Comment #13 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Tested in Firefox in a private window to make sure the cache was not to blame. Also restarted all the things. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31217 --- Comment #14 from Alex Buckley <alexbuckley@catalyst.net.nz> --- (In reply to Katrin Fischer from comment #13)
Tested in Firefox in a private window to make sure the cache was not to blame. Also restarted all the things.
Hey Katrin, Thank you for trying to test this! I wonder if you try testing with Google Chrome in an incognito window (as David did in comment #4) do you see the cover image on the OPAC detail page? Thanks, Alex -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31217 --- Comment #15 from Owen Leonard <oleonard@myacpl.org> --- I can reproduce the problem with this ISBN: 0590426850 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31217 Alex Buckley <alexbuckley@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #138198|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=31217 --- Comment #16 from Alex Buckley <alexbuckley@catalyst.net.nz> --- Created attachment 139218 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=139218&action=edit Bug 31217: OPAC coce.js is not hiding the coce-coverimg div for single-pixel images This is because opac-detail.tt has coce-coverimg as an ID, but OPAC coce.js targets coce-coverimg as a class. opac-detail.tt should be changed to have coce-coverimg as a class. Test plan: 1. Set your system preferences: - CoceHost = https://coce.mykoha.co.nz - CoceProviders = Select all - OpacCoce = Enable 2. Add the ISBN of '9780262336499' to a biblio 3. Open a "Incognito" window in your browser (recommended to use Google Chrome to test this) 4. View the biblio detail page in the OPAC. Observe a 'Coce image from Amazon' box loads with a spinner 5. Apply patch and restart services 6. Clear your browser cache 7. Reload the same biblio detail page in the OPAC. Observe no image is displayed. 8. View another OPAC biblio detail page that does have a successfully loading coce image and confirm the source of that image is listed: For example 'Coce image from Amazon.com' is displayed Sponsored-by: Toi Ohomai Institute of Technology, New Zealand Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> 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=31217 --- Comment #17 from Alex Buckley <alexbuckley@catalyst.net.nz> --- I have updated this patch so it is consistent with the staff client Coce fix - bug 31228 Now instead of line 1535 of koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt being: } else if( div.attr("class") == "cover-image coce-coverimg" ){ I use: } else if( div.hasClass("coce-coverimg" ) ){ Please let me know if I should remove the signoff lines or change the status of this bug report :) Many thanks, Alex -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31217 Fridolin Somers <fridolin.somers@biblibre.com> 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=31217 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #139218|0 |1 is obsolete| | --- Comment #18 from Fridolin Somers <fridolin.somers@biblibre.com> --- Created attachment 139344 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=139344&action=edit Bug 31217: OPAC coce.js is not hiding the coce-coverimg div for single-pixel images This is because opac-detail.tt has coce-coverimg as an ID, but OPAC coce.js targets coce-coverimg as a class. opac-detail.tt should be changed to have coce-coverimg as a class. Test plan: 1. Set your system preferences: - CoceHost = https://coce.mykoha.co.nz - CoceProviders = Select all - OpacCoce = Enable 2. Add the ISBN of '9780262336499' to a biblio 3. Open a "Incognito" window in your browser (recommended to use Google Chrome to test this) 4. View the biblio detail page in the OPAC. Observe a 'Coce image from Amazon' box loads with a spinner 5. Apply patch and restart services 6. Clear your browser cache 7. Reload the same biblio detail page in the OPAC. Observe no image is displayed. 8. View another OPAC biblio detail page that does have a successfully loading coce image and confirm the source of that image is listed: For example 'Coce image from Amazon.com' is displayed Sponsored-by: Toi Ohomai Institute of Technology, New Zealand Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31217 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to master Version(s)| |22.11.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=31217 --- Comment #19 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Pushed to master for 22.11. Nice work everyone, thanks! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31217 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|22.11.00 |22.11.00, 22.05.06 released in| | CC| |lucas@bywatersolutions.com Status|Pushed to master |Pushed to stable --- Comment #20 from Lucas Gass <lucas@bywatersolutions.com> --- Backported to 22.05.x for 22.05.06 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31217 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |victor@tuxayo.net Resolution|--- |FIXED Status|Pushed to stable |RESOLVED --- Comment #21 from Victor Grousset/tuxayo <victor@tuxayo.net> --- Not backported to oldoldstable (21.05.x). Feel free to ask if it's needed. Nothing to document it seems, marking resolved. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31217 Arthur Suzuki <arthur.suzuki@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|22.11.00, 22.05.06 |22.11.00,21.11, 22.05.06 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31217 --- Comment #22 from Arthur Suzuki <arthur.suzuki@biblibre.com> --- Thanks! Pushed to 21.11 for 21.11.12 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31217 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|22.11.00,21.11, 22.05.06 |22.11.00,22.05.06,21.11.12 released in| | -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org