From fd5cf82e9470c2f2eb2a71937dbd147e60237a33 Mon Sep 17 00:00:00 2001 From: Nicolas Legrand Date: Thu, 22 Oct 2020 18:17:47 +0200 Subject: [PATCH] Bug 24412: (follow-up) prevent error in svc/holds don't fail if a hold has no desk attached. --- svc/holds | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/svc/holds b/svc/holds index 5a60f3c..5e0a9d9 100755 --- a/svc/holds +++ b/svc/holds @@ -72,6 +72,12 @@ while ( my $h = $holds_rs->next() ) { my $biblionumber = $h->biblio()->biblionumber(); + my $desk_id = $h->desk_id; + my $desk_name = ''; + if ($desk_id) { + $desk_name = $h->desk()->desk_name(); + } + my $itemtype_limit; if ( $h->itemtype ) { my $itemtype = Koha::ItemTypes->find( $h->itemtype ); @@ -97,7 +103,7 @@ while ( my $h = $holds_rs->next() ) { reserve_id => $h->reserve_id(), branchcode => $h->branch()->branchname(), branches => $libraries, - desk_name => $h->desk()->desk_name(), + desk_name => $desk_name, reservedate => $h->reservedate(), expirationdate => $h->expirationdate(), suspend => $h->suspend(), -- 2.1.4