Bug 5731 When No ccode is defined for an item, then moredetail.pl throws a 500 error
authorPaul Poulain <paul.poulain@biblibre.com>
Tue, 14 Dec 2010 20:07:08 +0000 (21:07 +0100)
committerChris Nighswonger <chris.nighswonger@gmail.com>
Mon, 14 Feb 2011 02:38:52 +0000 (21:38 -0500)
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
(cherry picked from commit 1abf1ea2d009b15762bacd764fa5f66f915c6283)

Signed-off-by: Chris Nighswonger <chris.nighswonger@gmail.com>
catalogue/moredetail.pl

index d790c41..4f40b04 100755 (executable)
@@ -87,7 +87,7 @@ my $itemnumber;
 foreach my $item (@items){
     $item->{itemlostloop}= GetAuthorisedValues(GetAuthValCode('items.itemlost',$fw),$item->{itemlost}) if GetAuthValCode('items.itemlost',$fw);
     $item->{itemdamagedloop}= GetAuthorisedValues(GetAuthValCode('items.damaged',$fw),$item->{damaged}) if GetAuthValCode('items.damaged',$fw);
-    $item->{'collection'}              = $ccodes->{ $item->{ccode} };
+    $item->{'collection'}              = $ccodes->{ $item->{ccode} } if ($ccodes);
     $item->{'itype'}                   = $itemtypes->{ $item->{'itype'} }->{'description'};
     $item->{'replacementprice'}        = sprintf( "%.2f", $item->{'replacementprice'} );
     $item->{'datelastborrowed'}        = format_date( $item->{'datelastborrowed'} );