From 2d928a59f7fa6869082333b318ad895af5aca81c Mon Sep 17 00:00:00 2001 From: Andreas Roussos Date: Fri, 22 Jul 2022 13:36:14 +0200 Subject: [PATCH] Bug 31207: Fix the display of local cover images in the OPAC Shelf browser In the OPAC Details page for a biblio, opening the Shelf browser results in a nice display of adjacent items next to each other based on their call number, which also shows any cover images found. Since 21.11.00 this has been broken when local covers are exclusively in use, as it fails to fetch the related images that have been uploaded *at the biblio level*. This patch fixes that by adding back TT code that was removed in commit fad97080e97da5bc77724c68b9394aba15518847 (Bug 28180). Test plan: 0) Under Home > Administration > System preferences: - in section 'OPAC -> Shelf browser', make sure OPACShelfBrowser is enabled (i.e. set to 'Show') - in section 'Enhanced content -> Local or remote cover images', make sure both LocalCoverImages and OPACLocalCoverImages are enabled (i.e. set to 'Show') - make sure no other cover image provider is enabled - make sure OpacSeparateHoldings and OpacSeparateHoldingsBranch are set to 'Don't separate' and 'home library', respectively 1) In the Staff interface, create a record that has: - a local cover image at the biblio level (use the 'Images' tab in the Details page of the record to upload a test image) - at least one item attached to it that has a Call number (the call number value can be anything -- it's only needed to trigger the display of the 'Browse shelf' hyperlink) 2) In the OPAC, visit the Details page of the record you just added the cover image to, and click on the 'Browse shelf' link found in the 'Call number' column. When the Shelf browser expands, you'll notice there's no cover image displayed for the item(s) that belong to your test biblio. 3) Apply the patch and refresh the OPAC biblio Details page. This time the shelf browser should display the local cover images associated with your test record. 4) Make sure the relevant unit test passes: prove -v t/db_dependent/ShelfBrowser.t --- koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt index 7c30dafda9..e1b663a251 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt @@ -1771,6 +1771,13 @@ KOHA.OpenLibrary.GetCoverFromIsbn(); [% END %] + [% IF OPACLocalCoverImages %] + KOHA.LocalCover.GetCoverFromBibnumber(true); + [% IF itemloop_has_images OR otheritemloop_has_images %] + KOHA.LocalCover.GetCoverFromItemnumber(true); + [% END %] + [% END %] + [% IF ( NovelistSelectProfile && ( normalized_isbn || normalized_upc ) ) %] novSelect.loadContentForQuery( { -- 2.20.1