From 24b7675dac561ae34bf4bbf0295fbf7d008c3e8a Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Mon, 25 Jul 2022 10:16:48 -0300 Subject: [PATCH] Bug 29697: Fix t/db_dependent/Search.t Signed-off-by: Tomas Cohen Arazi --- C4/Search.pm | 6 ++++++ .../marc21/zebraexport/large_biblio/exported_records.xml | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/C4/Search.pm b/C4/Search.pm index 0ee8b5b8d0..5abf66b842 100644 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -1800,6 +1800,12 @@ sub searchResults { foreach my $code ( keys %subfieldstosearch ) { $item->{$code} = $field->subfield( $subfieldstosearch{$code} ); } + + unless ( $item->{itemnumber} ) { + warn "MARC item without itemnumber retrieved for biblio ($oldbiblio->{biblionumber})"; + next; + } + $item->{description} = $itemtypes{ $item->{itype} }{translated_description} if $item->{itype}; # OPAC hidden items diff --git a/t/db_dependent/data/marc21/zebraexport/large_biblio/exported_records.xml b/t/db_dependent/data/marc21/zebraexport/large_biblio/exported_records.xml index 4a58f8678e..10d79a1f98 100644 --- a/t/db_dependent/data/marc21/zebraexport/large_biblio/exported_records.xml +++ b/t/db_dependent/data/marc21/zebraexport/large_biblio/exported_records.xml @@ -1662,18 +1662,22 @@ aaabbb 1 + 123 bbbccc 0 + 124 cccddd 1 + 125 300 300 + 126 -- 2.39.5