Bug 20623: (QA follow-up) avoid fetch() calls in some cases
authorVictor Grousset <victor.grousset@biblibre.com>
Fri, 11 May 2018 15:43:33 +0000 (17:43 +0200)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Fri, 11 May 2018 17:11:12 +0000 (14:11 -0300)
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

acqui/basketgroup.pl

index 92a58ac..78514ba 100755 (executable)
@@ -194,9 +194,11 @@ sub printbasketgrouppdf{
                 }
             }
 
-            my $itemtype = Koha::ItemTypes->find( $biblioitem->itemtype );
-            my $item_has_type_description = $ord->{itemtype} && $biblioitem->itemtype && $itemtype;
-            $ord->{itemtype} = $item_has_type_description ? $itemtype->description : undef;
+            my $itemtype = ( $ord->{itemtype} and $biblioitem->itemtype )
+                ? Koha::ItemTypes->find( $biblioitem->itemtype )
+                : undef;
+            $ord->{itemtype} = $itemtype ? $itemtype->description : undef;
+
             $ord->{en} = $en ? $en : undef;
             $ord->{edition} = $edition ? $edition : undef;