Bug 29803 - Local cover images don't show in detail page, but only in results
Summary: Local cover images don't show in detail page, but only in results
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: unspecified
Hardware: PC Linux
: P5 - low major (vote)
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords:
Depends on: 28180
Blocks:
  Show dependency treegraph
 
Reported: 2022-01-05 21:01 UTC by Martin Morris
Modified: 2022-03-07 21:07 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
22.05.00,21.11.03


Attachments
Bug 29803: Prevent local cover image to be hidden if Coce is enabled (1.42 KB, patch)
2022-01-10 11:23 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 29803: Do not wait for the images more than 5 seconds (1.72 KB, patch)
2022-01-10 11:31 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 29803: Prevent local cover image to be hidden if Coce is enabled (1.48 KB, patch)
2022-02-14 21:35 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 29803: Do not wait for the images more than 5 seconds (1.77 KB, patch)
2022-02-14 21:35 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 29803: Prevent local cover image to be hidden if Coce is enabled (1.53 KB, patch)
2022-02-18 15:52 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 29803: Do not wait for the images more than 5 seconds (1.83 KB, patch)
2022-02-18 15:52 UTC, Nick Clemens
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Morris 2022-01-05 21:01:53 UTC
After upgrading to 21.11 from 21.05, locally cover images stopped loading on the details page for an individual biblio.  They still load in a listing of multiple biblios.  Additionally, images from the locally running Coce server load without problems.

Example of multiple listing where covers show as normal: https://katalogo.biblioteko.ca/cgi-bin/koha/opac-search.pl?q=au:%22Doyle%2C%20Arthur%20Conan%22

Example of individual biblio where locally stored cover doesn't load:
https://katalogo.biblioteko.ca/cgi-bin/koha/opac-detail.pl?biblionumber=2189&query_desc=au%3A%22Doyle%2C%20Arthur%20Conan%22
Comment 1 Owen Leonard 2022-01-06 13:08:39 UTC
The image is loading but it is hidden. I notice you have some CSS loading twice in your OPAC:

 <link href="/opac-tmpl/bootstrap/css/opac_21.1101000.css" type="text/css" rel="stylesheet">
 <link rel="stylesheet" type="text/css" href="/opac-tmpl/bootstrap/css/opac.css" />

Do you have a custom stylesheet defined somewhere? In the OpacAdditionalStylesheet system preference perhaps?
Comment 2 Martin Morris 2022-01-06 14:56:13 UTC
Thanks for the reply.  I do have some custom CSS which I had previously stripped out (from OpacAdditionalStylesheet and any other possible field), which didn't help at all.

I do also have a custom Coce server, hosted on the same machine, and I have now discovered that if I disable that the local cover images display correctly.  Is this a bug in 21.11 which causes a conflict between a locally hosted Coce server and locally stored cover images perhaps?  It worked perfectly under 21.05 and the previous versions of Koha I had used.
Comment 3 Owen Leonard 2022-01-06 15:17:32 UTC
Looks like it's working now?
Comment 4 Martin Morris 2022-01-06 15:35:16 UTC
Only if I disable Coce, and I do very much want/need that to be working as well.  So I wouldn't want to close this bug until that issue is resolved in case it's not just my system.
Comment 5 Owen Leonard 2022-01-06 16:39:58 UTC
(In reply to Owen Leonard from comment #1)
 
>  <link href="/opac-tmpl/bootstrap/css/opac_21.1101000.css" type="text/css"
> rel="stylesheet">
>  <link rel="stylesheet" type="text/css"
> href="/opac-tmpl/bootstrap/css/opac.css" />
> 
> Do you have a custom stylesheet defined somewhere? In the
> OpacAdditionalStylesheet system preference perhaps?

The source for that page still has two links to opac.css. I think that's the cause.
Comment 6 Martin Morris 2022-01-06 17:05:36 UTC
I have now stripped out all customisation of the OPAC css and the source shows that <link rel="stylesheet" type="text/css" href="/opac-tmpl/bootstrap/css/opac.css" /> is now absent.  Upon reenabling Coce the local cover image again fails to display.  Will leave the catalogue like this while investigating.
Comment 7 Katrin Fischer 2022-01-08 22:21:40 UTC
I've tested this with BywaterSolutions Coce server and for me it's the other way around. When both Coce and local covers are available, only the local cover shows on the detail page. The result page shows both.

I wonder if that has to do with bug 28180 - linking them just in case.
Comment 9 Jonathan Druart 2022-01-10 11:23:36 UTC
Created attachment 129247 [details] [review]
Bug 29803: Prevent local cover image to be hidden if Coce is enabled

If Coce is enabled by no image are returned by the service, then no
other image will be displayed (actually un-hidden)

The getURL is returning early if no image is returned by the service and
the "done" flag is never set.

Test plan:
Add a local cover image to a bibliographic record (ktd biblionumber=14
is good)
Set CoceHost = http://coce.bywatersolutions.com
Select all CoceProviders
Enable OpacCoce

=> If no image is returned by Coce then the local image should be
displayed anyway
Comment 10 Jonathan Druart 2022-01-10 11:31:19 UTC
Created attachment 129248 [details] [review]
Bug 29803: Do not wait for the images more than 5 seconds

In case of the previous bug, the page was calling the callback function
every 100ms, endlessly. We should add a test to prevent future similar
problem.

Test plan:
Remove the previous patch "Prevent local cover image to be hidden if
Coce is enabled"
Recreate the test plan
=> You should see the local image displayed after 5 seconds, and a
log in the JS console
Comment 11 Martin Morris 2022-01-10 15:52:45 UTC
Hello there

Both patches applied, and that worked!  Many thanks for your efforts on resolving this bug.

Martin
Comment 12 Eliana 2022-01-19 20:02:33 UTC
I believe we have the same issue as Martin (although we're on 21.05). I tried the troubleshooting suggestions above and they didn't work for me. Wondering what I'm missing here.

Covers show in opac-search.pl:
https://catalog.helmlib.org/cgi-bin/koha/opac-search.pl?idx=ti&q=Careers+in+psychology+%26+behavioral+health.&limit=&weight_search=1

No covers in opac-detail.pl:
https://catalog.helmlib.org/cgi-bin/koha/opac-detail.pl?biblionumber=1253757&query_desc=Careers%20in%20psychology%20%26%20behavioral%20health.

The local covers do load in opac-detail.pl sometimes, adding to my confusion:
https://catalog.helmlib.org/cgi-bin/koha/opac-detail.pl?biblionumber=1298655&query_desc=1298655

The ones that don't appear seem to blip in and out of existence as the page loads so they're being hidden by something. I've tried disabling JS which didn't solve the problem.
Comment 13 Martin Morris 2022-02-13 17:26:24 UTC
Good afternoon

I've just upgraded to 21.11.02 and this problem has returned.  Can I just reapply the patches which I previously applied for 21.11.01?

Martin
Comment 14 Jonathan Druart 2022-02-14 08:21:04 UTC
(In reply to Martin Morris from comment #13)
> Good afternoon
> 
> I've just upgraded to 21.11.02 and this problem has returned.  Can I just
> reapply the patches which I previously applied for 21.11.01?
> 
> Martin

Can you add your Signed-off-by lines to them? That will make them move forward.

https://wiki.koha-community.org/wiki/Sign_off_on_patches
Comment 15 Katrin Fischer 2022-02-14 21:30:04 UTC
(In reply to Martin Morris from comment #13)
> Good afternoon
> 
> I've just upgraded to 21.11.02 and this problem has returned.  Can I just
> reapply the patches which I previously applied for 21.11.01?
> 
> Martin

It will probably work, but you always have to be careful when applying manually locally. Better to get this moving into releases.
Comment 16 Katrin Fischer 2022-02-14 21:35:18 UTC
Created attachment 130579 [details] [review]
Bug 29803: Prevent local cover image to be hidden if Coce is enabled

If Coce is enabled by no image are returned by the service, then no
other image will be displayed (actually un-hidden)

The getURL is returning early if no image is returned by the service and
the "done" flag is never set.

Test plan:
Add a local cover image to a bibliographic record (ktd biblionumber=14
is good)
Set CoceHost = http://coce.bywatersolutions.com
Select all CoceProviders
Enable OpacCoce

=> If no image is returned by Coce then the local image should be
displayed anyway

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 17 Katrin Fischer 2022-02-14 21:35:22 UTC
Created attachment 130580 [details] [review]
Bug 29803: Do not wait for the images more than 5 seconds

In case of the previous bug, the page was calling the callback function
every 100ms, endlessly. We should add a test to prevent future similar
problem.

Test plan:
Remove the previous patch "Prevent local cover image to be hidden if
Coce is enabled"
Recreate the test plan
=> You should see the local image displayed after 5 seconds, and a
log in the JS console

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 18 Katrin Fischer 2022-02-14 21:35:55 UTC
I signed off, but you might want to have a look at the warning from QA test tools for QA:

 FAIL	koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt
   FAIL	  forbidden patterns
		forbidden pattern: console.log (line 1568)
Comment 19 Jonathan Druart 2022-02-14 21:54:03 UTC
The console.log is expected, see the second patch.
Comment 20 Katrin Fischer 2022-02-14 21:55:27 UTC
(In reply to Jonathan Druart from comment #19)
> The console.log is expected, see the second patch.

I thought it might, but always better to get any questions out of the way :)
Comment 21 Nick Clemens 2022-02-18 15:52:39 UTC
Created attachment 130866 [details] [review]
Bug 29803: Prevent local cover image to be hidden if Coce is enabled

If Coce is enabled by no image are returned by the service, then no
other image will be displayed (actually un-hidden)

The getURL is returning early if no image is returned by the service and
the "done" flag is never set.

Test plan:
Add a local cover image to a bibliographic record (ktd biblionumber=14
is good)
Set CoceHost = http://coce.bywatersolutions.com
Select all CoceProviders
Enable OpacCoce

=> If no image is returned by Coce then the local image should be
displayed anyway

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 22 Nick Clemens 2022-02-18 15:52:43 UTC
Created attachment 130867 [details] [review]
Bug 29803: Do not wait for the images more than 5 seconds

In case of the previous bug, the page was calling the callback function
every 100ms, endlessly. We should add a test to prevent future similar
problem.

Test plan:
Remove the previous patch "Prevent local cover image to be hidden if
Coce is enabled"
Recreate the test plan
=> You should see the local image displayed after 5 seconds, and a
log in the JS console

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 23 Fridolin Somers 2022-02-22 01:14:24 UTC
Pushed to master for 22.05, thanks to everybody involved 🦄
Comment 24 Kyle M Hall 2022-02-25 13:31:46 UTC
Pushed to 21.11.x for 21.11.03
Comment 25 Manos PETRIDIS 2022-03-05 12:54:34 UTC
Could this be related to https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30234 ?
Comment 26 Katrin Fischer 2022-03-06 11:37:49 UTC
(In reply to Manos PETRIDIS from comment #25)
> Could this be related to
> https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30234 ?

It could be a duplicate, but this bug has already been closed and pushed to stable versions, so best way to find out is to update :)
Comment 27 Manos PETRIDIS 2022-03-06 20:14:08 UTC
(In reply to Katrin Fischer from comment #26)
> (In reply to Manos PETRIDIS from comment #25)
> > Could this be related to
> > https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30234 ?
> 
> It could be a duplicate, but this bug has already been closed and pushed to
> stable versions, so best way to find out is to update :)

Unfortunately I'm already at 21.11.03.000 and apt-get reports there isn't anything new to install.
Comment 28 Andrew Fuerste-Henry 2022-03-07 21:07:50 UTC
Missing dependency, not backported to 21.05