Bug 10699: (follow-up) fix parameter test in DeleteBranchTransferLimits()
authorGalen Charlton <gmc@esilibrary.com>
Wed, 28 Aug 2013 15:33:35 +0000 (15:33 +0000)
committerGalen Charlton <gmc@esilibrary.com>
Wed, 28 Aug 2013 15:34:47 +0000 (15:34 +0000)
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 <gmc@esilibrary.com>
C4/Circulation.pm

index eea82a7..1dc7a45 100644 (file)
@@ -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);