From 729e3aa486973d7deb9a922af6e7d9aa48cabe05 Mon Sep 17 00:00:00 2001 From: Dobrica Pavlinusic Date: Wed, 20 Sep 2017 16:01:16 +0200 Subject: [PATCH] Bug 19350 - Holds without link in 773 trigger SQL::Abstract::puke Test: 1. find bibio without items which has something in field 773 (for us, it's article) but doesn't have 0 or 9 (host item entry) 2. click on hold in left menu 3. verify application error 4. apply patch and verify that it works Signed-off-by: Josef Moravec (cherry picked from commit 5c873a408f40fd1660d0b09c6de8c1ca2e252d11) Signed-off-by: Fridolin Somers (cherry picked from commit a2fd973b644c9956ce7c35bdc2fcdb7b0e71e45e) Signed-off-by: Katrin Fischer --- C4/Items.pm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/C4/Items.pm b/C4/Items.pm index 5861718208..b18da0a4d0 100644 --- a/C4/Items.pm +++ b/C4/Items.pm @@ -1661,7 +1661,12 @@ sub get_hostitemnumbers_of { foreach my $hostfield ( $marcrecord->field($tag) ) { my $hostbiblionumber = $hostfield->subfield($biblio_s); + next unless $hostbiblionumber; # have tag, don't have $biblio_s subfield my $linkeditemnumber = $hostfield->subfield($item_s); + if ( ! $linkeditemnumber ) { + warn "ERROR biblionumber $biblionumber has 773^0, but doesn't have 9"; + next; + } my @itemnumbers; if ( my $itemnumbers = get_itemnumbers_of($hostbiblionumber)->{$hostbiblionumber} ) -- 2.39.5