From 46b885487559670bd4ae1d680b1320f470f4935c Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 25 Jul 2022 14:48:02 +0200 Subject: [PATCH] Bug 29697: Fix t/db_dependent/Search.t FIXME This does not seem correct. I bet it was coming from a problem in our test data but apparently all the items in t/db_dependent/data/marc21/zebraexport/biblio/exported_records have a 952$9 I don't fully understand why we reach this code without itemnumber. Not sure this is the correct fix --- C4/Search.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/C4/Search.pm b/C4/Search.pm index 0ee8b5b8d02..3a5cfdbb46d 100644 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -1803,7 +1803,8 @@ sub searchResults { $item->{description} = $itemtypes{ $item->{itype} }{translated_description} if $item->{itype}; # OPAC hidden items - if ($is_opac) { + if ($is_opac && $item->{itemnumber}) { + # hidden based on OpacHiddenItems syspref or because lost my $hi = Koha::Items->search( { itemnumber => $item->{itemnumber} } ) ->filter_by_visible_in_opac({ patron => $search_context->{patron} }); -- 2.25.1