From 5d2374d643faf197d7729a5fef6ecb1480e03ffc Mon Sep 17 00:00:00 2001 From: Colin Campbell Date: Thu, 13 Oct 2011 16:28:59 +0100 Subject: [PATCH] Bug 6976 Close loophole allowing borrowers extra holds MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The variable canreserve was obly used when looping through multiple holds but was not being reinitialized on every iteration make variable local to loop it is used in and initialize to zero The loophole manifests thus: borrowers are only allowed Y holds. If holds are done individually, it is obeying that law i.e. X has held Y separate books – when I tried to do a 6th book it told me that I could not place a hold. However, if a borrower checks the catalogue, gets the intial list up and clicks items on the “results” box and then clicks “place hold” they can hold more than Y items Because the value was not being reset if 1 was ok all subsequent holds were ok --- opac/opac-reserve.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/opac/opac-reserve.pl b/opac/opac-reserve.pl index 2713cf3..6bd7cf8 100755 --- a/opac/opac-reserve.pl +++ b/opac/opac-reserve.pl @@ -164,7 +164,6 @@ foreach my $biblioNumber (@biblionumbers) { # if ( $query->param('place_reserve') ) { my $notes = $query->param('notes'); - my $canreserve=0; # List is composed of alternating biblio/item/branch my $selectedItems = $query->param('selecteditems'); @@ -197,6 +196,8 @@ if ( $query->param('place_reserve') ) { my $itemNum = shift(@selectedItems); my $branch = shift(@selectedItems); # i.e., branch code, not name + my $canreserve = 0; + my $singleBranchMode = $template->param('singleBranchMode'); if ($singleBranchMode || ! $OPACChooseBranch) { # single branch mode or disabled user choosing $branch = $borr->{'branchcode'}; -- 1.7.12.70.g851f7e6