From 1d2fc77230690c47c11c07b2fd7baaaf3868e4a9 Mon Sep 17 00:00:00 2001 From: toins Date: Tue, 17 Jul 2007 08:56:06 +0000 Subject: [PATCH] bugfix, 500 error when member has no reserve --- members/moremember.pl | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/members/moremember.pl b/members/moremember.pl index 7df572cfbb..7dc6c2652d 100755 --- a/members/moremember.pl +++ b/members/moremember.pl @@ -230,10 +230,6 @@ for ( my $i = 0 ; $i < $count ; $i++ ) { #check item is not reserved my ( $restype, $reserves ) = CheckReserves( $issue->[$i]{'itemnumber'} ); if ($restype) { - -# print "[$i]{'biblionumber'}>On Request - no renewals"; -# } elsif ($issue->[$i]->{'renewals'} > 0) { -# print "Previously Renewed - no renewals"; $row{'norenew'} = 1; } else { @@ -251,16 +247,20 @@ if ($borrowernumber) { # now we show the status of the borrower's reservations my @borrowerreserv = GetReservesFromBorrowernumber($borrowernumber ); my @reservloop; - foreach my $num_res (@borrowerreserv) { - next if not scalar @$num_res; + eval{ + scalar @$num_res; + }; + if($@){ + next; + } my %getreserv; my $getiteminfo = GetBiblioFromItemNumber( $num_res->{'itemnumber'} ); my $itemtypeinfo = getitemtypeinfo( $getiteminfo->{'itemtype'} ); my ( $transfertwhen, $transfertfrom, $transfertto ) = - GetTransfers( $num_res->{'itemnumber'} ); + GetTransfers( $num_res->{'itemnumber'} ); $getreserv{waiting} = 0; $getreserv{transfered} = 0; @@ -293,7 +293,7 @@ if ($borrowernumber) { { $getreserv{nottransfered} = 1; $getreserv{nottransferedby} = - GetBranchName( $getiteminfo->{'holdingbranch'} ); + GetBranchName( $getiteminfo->{'holdingbranch'} ); } # if we don't have a reserv on item, we put the biblio infos and the waiting position @@ -307,7 +307,7 @@ if ($borrowernumber) { $getreserv{itemtype} = $getbibtype->{'description'}; $getreserv{author} = $getbibinfo->{'author'}; $getreserv{itemcallnumber} = '----------'; - $getreserv{biblionumber} = $num_res->{'biblionumber'}; + $getreserv{biblionumber} = $num_res->{'biblionumber'}; } push( @reservloop, \%getreserv ); -- 2.39.5