As reported by Jonathan in bug 31217 koha-tmpl/intranet-tmpl/js/coce.js hides the coce-coverimg class. - In koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt coce-coverimg is a class. - In koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt coce-coverimg is an ID, not a class. As ID's are more specific, coce-coverimg should be changed to an ID in koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt And koha-tmpl/intranet-tmpl/js/coce.js should be changed to: $("#coce-coverimg").remove();
results will have several nodes, you cannot use an id there.
Oh course, thanks Jonathan. So we should aim to make coce-coverimg a class in koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt, correct?
That's certainly the best we can do, yes. We could also search for the ID and fallback to class if it does not exist. The main challenge in my opinion is to keep both opac and staff code as similar as possible (ie. switch to class for the OPAC if we decide so for staff)
(In reply to Jonathan Druart from comment #3) > That's certainly the best we can do, yes. > We could also search for the ID and fallback to class if it does not exist. > > The main challenge in my opinion is to keep both opac and staff code as > similar as possible (ie. switch to class for the OPAC if we decide so for > staff) Ahh yep, thanks for that Jonathan!
Created attachment 138112 [details] [review] Bug 31228: Intraneyt coce.js is not hiding the coce-coverimg div for single-pixel images This is because the intranet detail.tt has coce-coverimg as an ID. Intranet results.tt has coce-coverimg as a class. Intranet coce.js targets coce-coverimg as a class. Intranet detail.tt should be changed to have coce-coverimg as a class. This is inline with the change made to the OPAC in bug 31217 Test plan: 1. Set your system preferences: - CoceHost = https://coce.mykoha.co.nz - CoceProviders = Select all - IntranetCoce = 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 intranet. 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 intranet. Observe no image is displayed. 8. Do an intranet search to get the biblio returned in search results page. Confirm no cover image box is displayed 9. View the intranet search result and detail pages for a different biblio that you know Coce should be displaying the cover image of and confirm that it is correctly displayed with the source of that image listed: For example 'Coce image from Amazon.com' is displayed Sponsored-by: Catalyst IT, New Zealand
Created attachment 138113 [details] [review] Bug 31228: Intranet coce.js is not hiding the coce-coverimg div for single-pixel images This is because the intranet detail.tt has coce-coverimg as an ID. Intranet results.tt has coce-coverimg as a class. Intranet coce.js targets coce-coverimg as a class. Intranet detail.tt should be changed to have coce-coverimg as a class. This is inline with the change made to the OPAC in bug 31217 Test plan: 1. Set your system preferences: - CoceHost = https://coce.mykoha.co.nz - CoceProviders = Select all - IntranetCoce = 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 intranet. 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 intranet. Observe no image is displayed. 8. Do an intranet search to get the biblio returned in search results page. Confirm no cover image box is displayed 9. View the intranet search result and detail pages for a different biblio that you know Coce should be displaying the cover image of and confirm that it is correctly displayed with the source of that image listed: For example 'Coce image from Amazon.com' is displayed Sponsored-by: Catalyst IT, New Zealand
Created attachment 138187 [details] [review] Bug 31228: Intranet coce.js is not hiding the coce-coverimg div for single-pixel images This is because the intranet detail.tt has coce-coverimg as an ID. Intranet results.tt has coce-coverimg as a class. Intranet coce.js targets coce-coverimg as a class. Intranet detail.tt should be changed to have coce-coverimg as a class. This is inline with the change made to the OPAC in bug 31217 Test plan: 1. Set your system preferences: - CoceHost = https://coce.mykoha.co.nz - CoceProviders = Select all - IntranetCoce = 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 intranet. 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 intranet. Observe no image is displayed. 8. Do an intranet search to get the biblio returned in search results page. Confirm no cover image box is displayed 9. View the intranet search result and detail pages for a different biblio that you know Coce should be displaying the cover image of and confirm that it is correctly displayed with the source of that image listed: For example 'Coce image from Amazon.com' is displayed Sponsored-by: Catalyst IT, New Zealand Signed-off-by: Owen Leonard <oleonard@myacpl.org>
I see results.js contains : if( div.hasClass("coce-coverimg") ){ Would be better to use this instead of : else if( div.attr("class") == "cover-image coce-coverimg" ){ No ?
Created attachment 139095 [details] [review] Bug 31228: Intranet coce.js is not hiding the coce-coverimg div for single-pixel images This is because the intranet detail.tt has coce-coverimg as an ID. Intranet results.tt has coce-coverimg as a class. Intranet coce.js targets coce-coverimg as a class. Intranet detail.tt should be changed to have coce-coverimg as a class. This is inline with the change made to the OPAC in bug 31217 Test plan: 1. Set your system preferences: - CoceHost = https://coce.mykoha.co.nz - CoceProviders = Select all - IntranetCoce = 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 intranet. 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 intranet. Observe no image is displayed. 8. Do an intranet search to get the biblio returned in search results page. Confirm no cover image box is displayed 9. View the intranet search result and detail pages for a different biblio that you know Coce should be displaying the cover image of and confirm that it is correctly displayed with the source of that image listed: For example 'Coce image from Amazon.com' is displayed Sponsored-by: Catalyst IT, New Zealand
Created attachment 139096 [details] [review] Bug 31228: (Alternate patch) Intranet coce.js is not hiding the coce-coverimg div for single-pixel image This is because the intranet detail.tt has coce-coverimg as an ID. Intranet results.tt has coce-coverimg as a class. Intranet coce.js targets coce-coverimg as a class. Intranet detail.tt should be changed to have coce-coverimg as a class. This is inline with the change made to the OPAC in bug 31217 Test plan: 1. Set your system preferences: - CoceHost = https://coce.mykoha.co.nz - CoceProviders = Select all - IntranetCoce = 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 intranet. 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 intranet. Observe no image is displayed. 8. Do an intranet search to get the biblio returned in search results page. Confirm no cover image box is displayed 9. View the intranet search result and detail pages for a different biblio that you know Coce should be displaying the cover image of and confirm that it is correctly displayed with the source of that image listed: For example 'Coce image from Amazon.com' is displayed Sponsored-by: Catalyst IT, New Zealand
(In reply to Fridolin Somers from comment #8) > I see results.js contains : > if( div.hasClass("coce-coverimg") ){ > > Would be better to use this instead of : > else if( div.attr("class") == "cover-image coce-coverimg" ){ > > No ? Hi Fridolin, I have attached an alternate patch, is that what you had in mind regarding the above? Thanks, Alex
Created attachment 139217 [details] [review] Bug 31228: Intranet coce.js is not hiding the coce-coverimg div for single-pixel image This is because the intranet detail.tt has coce-coverimg as an ID. Intranet results.tt has coce-coverimg as a class. Intranet coce.js targets coce-coverimg as a class. Intranet detail.tt should be changed to have coce-coverimg as a class. This is inline with the change made to the OPAC in bug 31217 Test plan: 1. Set your system preferences: - CoceHost = https://coce.mykoha.co.nz - CoceProviders = Select all - IntranetCoce = 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 intranet. 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 intranet. Observe no image is displayed. 8. Do an intranet search to get the biblio returned in search results page. Confirm no cover image box is displayed 9. View the intranet search result and detail pages for a different biblio that you know Coce should be displaying the cover image of and confirm that it is correctly displayed with the source of that image listed: For example 'Coce image from Amazon.com' is displayed Sponsored-by: Catalyst IT, New Zealand Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(In reply to Alex Buckley from comment #11) > (In reply to Fridolin Somers from comment #8) > > I see results.js contains : > > if( div.hasClass("coce-coverimg") ){ > > > > Would be better to use this instead of : > > else if( div.attr("class") == "cover-image coce-coverimg" ){ > > > > No ? > > Hi Fridolin, > > I have attached an alternate patch, is that what you had in mind regarding > the above? > > Thanks, > Alex Yes perfect. I've passed QA this patch, obsoleted the other and removed the "alternate" text in commit message. I also reported the signoff line from Owen. Best regards ;)
(In reply to Fridolin Somers from comment #13) > (In reply to Alex Buckley from comment #11) > > (In reply to Fridolin Somers from comment #8) > > > I see results.js contains : > > > if( div.hasClass("coce-coverimg") ){ > > > > > > Would be better to use this instead of : > > > else if( div.attr("class") == "cover-image coce-coverimg" ){ > > > > > > No ? > > > > Hi Fridolin, > > > > I have attached an alternate patch, is that what you had in mind regarding > > the above? > > > > Thanks, > > Alex > > Yes perfect. > > I've passed QA this patch, obsoleted the other and removed the "alternate" > text in commit message. > I also reported the signoff line from Owen. > > Best regards ;) Thanks very much Fridolin!
Also, just to note I have updated the OPAC coce fix ( bug 31217 ) to be consistent in using: else if( div.hasClass("coce-coverimg" ) ){
Pushed to master for 22.11. Nice work everyone, thanks!
Backported to 22.05.x for 22.05.06
Not backported to oldoldstable (21.05.x). Feel free to ask if it's needed. Nothing to document it seems, marking resolved.
Thanks! Pushed to 21.11 for 21.11.12