[Koha-patches] [PATCH] Bug 5731 When No ccode is defined for an item, then moredetail.pl throws a 500 error

Chris Cormack chrisc at catalyst.net.nz
Thu Feb 10 02:44:24 CET 2011


From: Paul Poulain <paul.poulain at biblibre.com>

Signed-off-by: Chris Cormack <chrisc at catalyst.net.nz>
---
 catalogue/moredetail.pl |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/catalogue/moredetail.pl b/catalogue/moredetail.pl
index d790c41..4f40b04 100755
--- a/catalogue/moredetail.pl
+++ b/catalogue/moredetail.pl
@@ -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'} );
-- 
1.7.1



More information about the Koha-patches mailing list