Bug 10693 - CreateBranchTransferLimit's return values in C4::Circulation.pm should be more explicit
Summary: CreateBranchTransferLimit's return values in C4::Circulation.pm should be mor...
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: kenza
QA Contact: Testopia
URL:
Keywords:
Depends on: 10692
Blocks:
  Show dependency treegraph
 
Reported: 2013-08-07 14:12 UTC by kenza
Modified: 2014-12-07 20:03 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 10693: CreateBranchTransferLimit's return value in C4::Circulation.pm should be more explicit (3.24 KB, patch)
2013-08-07 14:43 UTC, kenza
Details | Diff | Splinter Review
Bug 10693: CreateBranchTransferLimit's return value in C4::Circulation.pm should be more explicit (3.29 KB, patch)
2013-08-08 05:44 UTC, Chris Cormack
Details | Diff | Splinter Review
[PASSED QA] Bug 10693: CreateBranchTransferLimit's return value in C4::Circulation.pm should be more explicit (3.40 KB, patch)
2013-08-27 20:50 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description kenza 2013-08-07 14:12:52 UTC

    
Comment 1 kenza 2013-08-07 14:43:25 UTC Comment hidden (obsolete)
Comment 2 Chris Cormack 2013-08-08 05:44:00 UTC Comment hidden (obsolete)
Comment 3 Katrin Fischer 2013-08-27 20:50:32 UTC
Created attachment 20670 [details] [review]
[PASSED QA] Bug 10693: CreateBranchTransferLimit's return value in C4::Circulation.pm should be more explicit

This patch test if the parameters $toBranch and $fromBranch are given.
If not, CreateBranchTransferLimit now returns undef.
This patch also fixes and adds some regression tests in
t/db_dependent/Circulation_transfers.t

NOTE:
Currently, we can add a transferlimit to nonexistent branches because
in the database branch_transfer_limits.toBranch
and branch_transfer_limits.fromBranch aren't foreign keys.

To test:
prove t/db_dependent/Circulation_transfers.t
t/db_dependent/Circulation_transfers.t .. ok
All tests successful.
Files=1, Tests=15, 18 wallclock secs ( 0.02 usr  0.01 sys +  0.42 cusr  0.00 csys =  0.45 CPU)
Result: PASS

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
All tests and QA script pass.
Comment 4 Katrin Fischer 2013-08-27 20:51:27 UTC
Tested with patch for 10692 applied.
Comment 5 Galen Charlton 2013-08-28 15:19:07 UTC
Pushed to master, along with a follow-up that corrects the parameter tests to check for definedness, not Perl truth.  Thanks, Kenza!
Comment 6 Tomás Cohen Arazi 2013-09-13 18:05:35 UTC
This patch has been pushed to 3.12.x, will be in 3.12.5.

Thanks Kenza!