From: Galen Charlton Date: Wed, 28 Aug 2013 15:33:35 +0000 (+0000) Subject: Bug 10699: (follow-up) fix parameter test in DeleteBranchTransferLimits() X-Git-Url: http://git.rot13.org/?a=commitdiff_plain;h=ac11a5d9ff982d89ed1f00ca585e1ecb9e0195eb;p=koha.git Bug 10699: (follow-up) fix parameter test in DeleteBranchTransferLimits() Need to check for definedness, not Perl truth. Also adds description of the return value to the POD. To test: Run prove -v t/db_dependent/Circulation_transfers.t and verify that the tests pass. Signed-off-by: Galen Charlton --- diff --git a/C4/Circulation.pm b/C4/Circulation.pm index eea82a785a..1dc7a45e75 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -3262,15 +3262,17 @@ sub CreateBranchTransferLimit { =head2 DeleteBranchTransferLimits -DeleteBranchTransferLimits($frombranch); + my $result = DeleteBranchTransferLimits($frombranch); -Deletes all the branch transfer limits for one branch +Deletes all the library transfer limits for one library. Returns the +number of limits deleted, 0e0 if no limits were deleted, or undef if +no arguments are supplied. =cut sub DeleteBranchTransferLimits { my $branch = shift; - return unless $branch; + return unless defined $branch; my $dbh = C4::Context->dbh; my $sth = $dbh->prepare("DELETE FROM branch_transfer_limits WHERE fromBranch = ?"); return $sth->execute($branch);