From: Galen Charlton Date: Wed, 28 Aug 2013 15:16:28 +0000 (+0000) Subject: Bug 10693: (follow-up) fix parameter checking in CreateBranchTransferLimit() X-Git-Url: http://git.rot13.org/?a=commitdiff_plain;h=6751c5dc7c963defd0a31adfd46d0665abf41cd6;hp=3c61f95fb41152994ca2807eee87dc8e13ba219d;p=koha.git Bug 10693: (follow-up) fix parameter checking in CreateBranchTransferLimit() 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 --- diff --git a/C4/Circulation.pm b/C4/Circulation.pm index d120dfdcad..94ef6c85e7 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -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;