Bug 19484: Add test before using object itemtype
authorMarcel de Rooy <m.de.rooy@rijksmuseum.nl>
Wed, 18 Oct 2017 14:00:34 +0000 (16:00 +0200)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Fri, 27 Oct 2017 17:09:01 +0000 (14:09 -0300)
Patch applies and functions as described. I agree with you that importing NULL itemtypes is possible Marcel. A higher importance level makes sense.

Signed-off-by: Dilan Johnpullé <dilan@calyx.net.au>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

svc/checkouts

index 98251b5..e42f369 100755 (executable)
@@ -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},