Bug 32412 - OPACShelfBrowser controls add extra Coce images to biblio-cover-slider
Summary: OPACShelfBrowser controls add extra Coce images to biblio-cover-slider
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Lucas Gass
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks: 33848
  Show dependency treegraph
 
Reported: 2022-12-06 21:31 UTC by Lucas Gass
Modified: 2023-09-19 05:26 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
23.05.00,22.11.06,22.05.14


Attachments
Bug 32412: Empty coce container before appending image (1.28 KB, patch)
2023-04-04 21:54 UTC, Lucas Gass
Details | Diff | Splinter Review
Bug 32412: Empty coce container before appending image (1.34 KB, patch)
2023-04-05 15:15 UTC, ByWater Sandboxes
Details | Diff | Splinter Review
Bug 32412: Do not reload COCE image for biblio (3.62 KB, patch)
2023-05-03 09:18 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 32412: Do not reload COCE image for biblio (3.67 KB, patch)
2023-05-03 21:37 UTC, Lucas Gass
Details | Diff | Splinter Review
Bug 32412: Empty coce container before appending image (1.41 KB, patch)
2023-05-04 06:21 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 32412: Do not reload COCE image for biblio (3.75 KB, patch)
2023-05-04 06:21 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Lucas Gass 2022-12-06 21:31:24 UTC
To recreate:
1. Turn on Coce for the OPAC. 
2. OPACShelfBrowser must be on
3. Find a record that returns a cover image and open it's detail page.
4. Use the next/previous navigation links in the OPACShelfBrowser
5. Notice how everytime you click on a control an extra cover image is added to the biblio-cover-slider
Comment 1 Lucas Gass 2023-04-04 21:54:03 UTC
Created attachment 149143 [details] [review]
Bug 32412: Empty coce container before appending image

To test:
1. Apply patch and clear browser cache
2. Turn on Coce for the OPAC.
3. OPACShelfBrowser must be on
4. Find a record that returns a cover image and open it's detail page.
5. Use the next/previous navigation links in the OPACShelfBrowser
6. Notice that no extra image is being added to the biblio-cover-slider.
7. Make sure that Coce images still load correctly in on the OPAC detail page, OPAC results page, and in the shelf browser.
Comment 2 ByWater Sandboxes 2023-04-05 15:15:46 UTC
Created attachment 149219 [details] [review]
Bug 32412: Empty coce container before appending image

To test:
1. Apply patch and clear browser cache
2. Turn on Coce for the OPAC.
3. OPACShelfBrowser must be on
4. Find a record that returns a cover image and open it's detail page.
5. Use the next/previous navigation links in the OPACShelfBrowser
6. Notice that no extra image is being added to the biblio-cover-slider.
7. Make sure that Coce images still load correctly in on the OPAC detail page, OPAC results page, and in the shelf browser.

Signed-off-by: Andrew Auld <andrew.auld@ptfs-europe.com>
Comment 3 Andrew Auld 2023-04-05 15:16:10 UTC
Works perfectly. Thanks!
Comment 4 Jonathan Druart 2023-05-03 09:18:30 UTC
Created attachment 150567 [details] [review]
Bug 32412: Do not reload COCE image for biblio

We do not want to fetch again the new image for the biblio record. We
only want to fetch those for the shelf browser.

Note that the third parameter 'covernewwindow' was not used.
Comment 5 Jonathan Druart 2023-05-03 09:18:49 UTC
Lucas, your patch is working but I think it's actually hiding another bug: we should not reload the image for the bibliographic record when we are browsing the shelf.

Do you agree with my follow-up patch?
Comment 6 Lucas Gass 2023-05-03 21:34:35 UTC
(In reply to Jonathan Druart from comment #5)
> Lucas, your patch is working but I think it's actually hiding another bug:
> we should not reload the image for the bibliographic record when we are
> browsing the shelf.
> 
> Do you agree with my follow-up patch?

yes
Comment 7 Lucas Gass 2023-05-03 21:37:35 UTC
Created attachment 150620 [details] [review]
Bug 32412: Do not reload COCE image for biblio

We do not want to fetch again the new image for the biblio record. We
only want to fetch those for the shelf browser.

Note that the third parameter 'covernewwindow' was not used.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 8 Jonathan Druart 2023-05-04 06:21:02 UTC
Created attachment 150625 [details] [review]
Bug 32412: Empty coce container before appending image

To test:
1. Apply patch and clear browser cache
2. Turn on Coce for the OPAC.
3. OPACShelfBrowser must be on
4. Find a record that returns a cover image and open it's detail page.
5. Use the next/previous navigation links in the OPACShelfBrowser
6. Notice that no extra image is being added to the biblio-cover-slider.
7. Make sure that Coce images still load correctly in on the OPAC detail page, OPAC results page, and in the shelf browser.

Signed-off-by: Andrew Auld <andrew.auld@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 9 Jonathan Druart 2023-05-04 06:21:05 UTC
Created attachment 150626 [details] [review]
Bug 32412: Do not reload COCE image for biblio

We do not want to fetch again the new image for the biblio record. We
only want to fetch those for the shelf browser.

Note that the third parameter 'covernewwindow' was not used.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 10 Tomás Cohen Arazi 2023-05-05 13:15:05 UTC
Pushed to master for 23.05.

Nice work everyone, thanks!
Comment 11 Martin Renvoize 2023-05-12 14:42:38 UTC
Many hands makes light work, thankyou everyone!

Pushed to 22.11.x for the next release
Comment 12 Owen Leonard 2023-05-25 17:16:56 UTC
I'm not seeing any images in the shelf browser after this patch. In the console I see "Uncaught TypeError: parent.find is not a function" from coce.js
Comment 13 Lucas Gass 2023-06-13 15:57:45 UTC
Backported to 22.05.x for upcoming 22.05.14
Comment 14 Danyon Sewell 2023-07-20 00:12:36 UTC
Not backporting to 21.11.x
Comment 15 Frédéric Demians 2023-09-14 07:17:26 UTC
(In reply to Owen Leonard from comment #12)
> I'm not seeing any images in the shelf browser after this patch. In the
> console I see "Uncaught TypeError: parent.find is not a function" from
> coce.js

Same here on 22.11. Can't say yet on 23.05.
Comment 16 Jonathan Druart 2023-09-18 20:45:07 UTC
(In reply to Frédéric Demians from comment #15)
> (In reply to Owen Leonard from comment #12)
> > I'm not seeing any images in the shelf browser after this patch. In the
> > console I see "Uncaught TypeError: parent.find is not a function" from
> > coce.js
> 
> Same here on 22.11. Can't say yet on 23.05.

Seen bug 33848?
Comment 17 Frédéric Demians 2023-09-19 05:26:53 UTC
(In reply to Jonathan Druart from comment #16)
> Seen bug 33848?

No, but I should have, since it's the solution. Thanks.