Bug 10693: (follow-up) fix parameter checking in CreateBranchTransferLimit()
authorGalen Charlton <gmc@esilibrary.com>
Wed, 28 Aug 2013 15:16:28 +0000 (15:16 +0000)
committerGalen Charlton <gmc@esilibrary.com>
Wed, 28 Aug 2013 15:16:28 +0000 (15:16 +0000)
There is nothing prevent '0' from being used as a library code.

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 d120dfd..94ef6c8 100644 (file)
@@ -3251,7 +3251,7 @@ $code is either itemtype or collection code depending on what the pref BranchTra
 
 sub CreateBranchTransferLimit {
    my ( $toBranch, $fromBranch, $code ) = @_;
-   return unless ($toBranch && $fromBranch);
+   return unless defined($toBranch) && defined($fromBranch);
    my $limitType = C4::Context->preference("BranchTransferLimitsType");
    
    my $dbh = C4::Context->dbh;