Bug 5731 When No ccode is defined for an item, then moredetail.pl throws a 500 error

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
This commit is contained in:
Paul Poulain 2010-12-14 21:07:08 +01:00 committed by Chris Cormack
parent d7208f76bd
commit 1abf1ea2d0

View file

@ -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'} );