From f30ed1eb0795f5914a7efb33b0f8a0c3d8d711da 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 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit don't fail if a hold has no desk attached. Signed-off-by: Séverine QUEUNE Signed-off-by: Martin Renvoize --- svc/holds | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/svc/holds b/svc/holds index 5a60f3c0e4..5e0a9d91fb 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.20.1