Bug 32542

Summary: Coce images not appearing in staff interface
Product: Koha Reporter: Lucas Gass (lukeg) <lucas>
Component: CatalogingAssignee: Bugs List <koha-bugs>
Status: NEW --- QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: andrew, danielle.meininger, esther.melander, jonathan.druart, kebliss, m.de.rooy, madamyk, mspinney, nick, pierre.genty, rcoert
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35647
GIT URL: Initiative type: ---
Sponsorship status: --- Crowdfunding goal: 0
Patch complexity: --- Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
Circulation function:
Bug Depends on: 32307    
Bug Blocks:    
Attachments: Bug 32542: Add 'wait_for_images' to results.js'

Description Lucas Gass (lukeg) 2022-12-28 20:31:40 UTC
To recreate:

1. Have Coce on, use 'https://coce.bywatersolututions.com' as the CoceProviders if needed. Select all providers
2. Turn on IntranetCoce and OpacCoce.
3. Do a OPAC search to retrieve some Coce images on both the OPAC results page and detail. 
4. Do the same search and look at the same detail pages in the staff client. Nothing appears.
Comment 1 Lucas Gass (lukeg) 2022-12-29 17:55:00 UTC
It seems like what is happening here is that we are removing the containers prematurely. 

coce.js fetches the images and adds them but not before other JS in results.js is deciding there is no image and removing the container.
Comment 2 Esther Melander 2023-03-14 17:52:44 UTC
This problem appears to be intermittent and random. For example, do a catalog search in the staff interface and the image will not show. Do the same search a few days later and the image shows. When doing a search and building a list with lots of different titles, some cover images show, others do not. We have tested different browsers, deleting cache, having librarians search on different browsers and computers, and the book covers will show one place and not another. We cannot pinpoint a reproducible show/not show of book cover images.
Comment 3 Lucas Gass (lukeg) 2023-06-29 15:18:45 UTC
(In reply to Esther Melander from comment #2)
> This problem appears to be intermittent and random. For example, do a
> catalog search in the staff interface and the image will not show. Do the
> same search a few days later and the image shows. When doing a search and
> building a list with lots of different titles, some cover images show,
> others do not. We have tested different browsers, deleting cache, having
> librarians search on different browsers and computers, and the book covers
> will show one place and not another. We cannot pinpoint a reproducible
> show/not show of book cover images.

Esther, the problem being intermittent and random makes sense to me. When the call to Coce takes too long we removed the parent container. So this can depend on the speed of your network connection.

I can more reliably recreate the issue when I clear my cache, as it then takes more time to load the images when nothing is cached.
Comment 4 Nick Clemens (kidclamp) 2025-09-23 19:02:18 UTC
Created attachment 186842 [details] [review]
Bug 32542: Add 'wait_for_images' to results.js'
Comment 5 Nick Clemens (kidclamp) 2025-09-23 19:02:59 UTC
I think we need the fix from bug 32307 on the results page too

I tried, Coce is at least called now, but it still doesn't show the images
Comment 6 Jonathan Druart 2025-09-25 12:24:14 UTC
Nick, your patch is working for me. The first try I saw the warning in the console, but once the images are cached they appeared. Maybe we should extend the timeout then? But it's 5 seconds already...
Comment 7 Jonathan Druart 2025-09-25 12:30:39 UTC
(In reply to Jonathan Druart from comment #6)
> Nick, your patch is working for me. The first try I saw the warning in the
> console, but once the images are cached they appeared. Maybe we should
> extend the timeout then? But it's 5 seconds already...

It's actually the coce server that is slow. The request takes 8 seconds.
Comment 8 Lucas Gass (lukeg) 2025-10-08 18:02:00 UTC
(In reply to Jonathan Druart from comment #6)
> Nick, your patch is working for me. The first try I saw the warning in the
> console, but once the images are cached they appeared. Maybe we should
> extend the timeout then? But it's 5 seconds already...

This is exactly what I experience when I test.
Comment 9 Lucas Gass (lukeg) 2025-10-28 14:29:00 UTC
*** Bug 35647 has been marked as a duplicate of this bug. ***