diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt index 6d3c34c0a9..ccc0296ca8 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt @@ -340,7 +340,7 @@
- [% IF ( OPACLocalCoverImages ) %] + [% IF ( OPACLocalCoverImages && SEARCH_RESULT.has_local_cover_image ) %] [% END %] diff --git a/opac/opac-search.pl b/opac/opac-search.pl index 16b69332ff..540b693ace 100755 --- a/opac/opac-search.pl +++ b/opac/opac-search.pl @@ -702,6 +702,10 @@ for (my $i=0;$i<@servers;$i++) { # BZ17530: 'Intelligent' guess if result can be article requested $res->{artreqpossible} = ( $art_req_itypes->{ $res->{itemtype} // q{} } || $art_req_itypes->{ '*' } ) ? 1 : q{}; + + if ( C4::Context->preference('OPACLocalCoverImages') ) { + $res->{has_local_cover_image} = $res->{biblio_object}->cover_images->count; + } } if ($results_hashref->{$server}->{"hits"}){