From 096d29f56ad74e3142876198a888fb8154d41f28 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 11 Nov 2019 10:14:14 +0100 Subject: [PATCH] Bug 23785: Fix call get_coins on undef value in opac-search.pl If the search engine index returns a record that is no longer in the DB, an OPAC search will explode with: Can't call method "get_coins" on an undefined value at /usr/share/koha/opac/cgi-bin/opac/opac-search.pl line 692. Signed-off-by: Marcel de Rooy Signed-off-by: Martin Renvoize Signed-off-by: Joy Nelson (cherry picked from commit 8073350819ea0fa73e3492e62b52575fecaecc3e) Signed-off-by: Lucas Gass --- opac/opac-search.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opac/opac-search.pl b/opac/opac-search.pl index 9f18049e4b..43249702c8 100755 --- a/opac/opac-search.pl +++ b/opac/opac-search.pl @@ -689,7 +689,7 @@ for (my $i=0;$i<@servers;$i++) { if (C4::Context->preference('COinSinOPACResults')) { my $biblio = Koha::Biblios->find( $res->{'biblionumber'} ); - $res->{coins} = $biblio->get_coins; + $res->{coins} = $biblio ? $biblio->get_coins : q{}; # FIXME This should be moved at the beginning of the @newresults loop } if ( C4::Context->preference( "Babeltheque" ) and $res->{normalized_isbn} ) { if( my $isbn = Business::ISBN->new( $res->{normalized_isbn} ) ) { -- 2.39.5