From dd7f38f985ad9996d882c9c84d51a7f313397070 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Wed, 18 Oct 2017 16:00:34 +0200 Subject: [PATCH] Bug 19484: Add test before using object itemtype Content-Type: text/plain; charset=utf-8 Resolves this crash: item-level_itypes set but no itemtype set for item (451) at /usr/share/koha/masterclone/Koha/Schema/Result/Item.pm line 698. Can't call method "translated_description" on an undefined value at /usr/share/koha/masterclone/svc/checkouts line 168. Test plan: [1] Create/update an item so that it has itemtype NULL. [2] Check it out on Circulation page. Before this patch the loading would never stop. Signed-off-by: Marcel de Rooy --- svc/checkouts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/svc/checkouts b/svc/checkouts index 98251b5..e42f369 100755 --- a/svc/checkouts +++ b/svc/checkouts @@ -171,7 +171,7 @@ while ( my $c = $sth->fetchrow_hashref() ) { author => $c->{author}, barcode => $c->{barcode}, itemtype => $item_level_itypes ? $c->{itype} : $c->{itemtype}, - itemtype_description => $itemtype->translated_description, + itemtype_description => $itemtype ? $itemtype->translated_description : q{}, location => $location, homebranch => $c->{homebranch}, itemnotes => $c->{itemnotes}, -- 2.1.4