Bug 17599

Summary: Move C4::Circulation::GetIssuingRule to Koha::IssuingRules->get_effective_issuing_rule
Product: Koha Reporter: Jonathan Druart <jonathan.druart>
Component: Architecture, internals, and plumbingAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: kyle, tomascohen
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17591
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17633
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on:    
Bug Blocks: 17677, 17783    
Attachments: Bug 17599 - Move C4::Circulation::GetIssuingRule to Koha::IssuingRules->get_effective_issuing_rule
Bug 17599 - Move C4::Circulation::GetIssuingRule to Koha::IssuingRules->get_effective_issuing_rule
Bug 17599: (QA followup) Remove userenv warning
Bug 17599: Move C4::Circulation::GetIssuingRule to Koha::IssuingRules->get_effective_issuing_rule
Bug 17599: (QA followup) Remove userenv warning
Bug 17599: (QA followup) Perltidy really long lines
Bug 17599: Make the tests pass

Description Jonathan Druart 2016-11-09 16:38:02 UTC
We need to move the GetIssuingRule subroutine because of the side effects it causes to use C4::Circulation from the Koha namespace (see bug 17591)
Comment 1 Jonathan Druart 2016-11-09 16:39:19 UTC
Created attachment 57393 [details] [review]
Bug 17599 - Move C4::Circulation::GetIssuingRule to Koha::IssuingRules->get_effective_issuing_rule

This is a POC, I have not tested it yet.
Comment 2 Kyle M Hall 2016-11-15 15:01:20 UTC
Created attachment 57494 [details] [review]
Bug 17599 - Move C4::Circulation::GetIssuingRule to Koha::IssuingRules->get_effective_issuing_rule

Test Plan:
1) Apply this patch
2) Generate a test of 6 test rules using every combination of library,
    item type and patron type with different loan lengths
3) Perform a checkout of the patron type and item type
4) Note the correct rule was selected
5) Remove the most specific rule
6) Return and check out again
7) Repeat steps 4-6 until you have tested all 6 rules

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 3 Tomás Cohen Arazi 2016-11-15 15:28:53 UTC
Created attachment 57501 [details] [review]
Bug 17599: (QA followup) Remove userenv warning

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 4 Tomás Cohen Arazi 2016-11-15 15:35:36 UTC
Created attachment 57502 [details] [review]
Bug 17599: Move C4::Circulation::GetIssuingRule to Koha::IssuingRules->get_effective_issuing_rule

This is a POC, I have not tested it yet.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 5 Tomás Cohen Arazi 2016-11-15 15:35:43 UTC
Created attachment 57503 [details] [review]
Bug 17599: (QA followup) Remove userenv warning

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 6 Tomás Cohen Arazi 2016-11-15 15:35:49 UTC
Created attachment 57504 [details] [review]
Bug 17599: (QA followup) Perltidy really long lines

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 7 Kyle M Hall 2016-11-15 15:42:47 UTC
Pushed to master for 16.11, thanks Jonathan, Tomas!
Comment 8 Jonathan Druart 2016-11-15 15:51:14 UTC
Created attachment 57506 [details] [review]
Bug 17599: Make the tests pass

If you run TooMany or MultiplePerRecord.t after
t/db_dependent/Circulation/Returns.t (for instance) and that you are
running memcached, item-level_itypes will be 0.
These tests assume that the pref is 1
Comment 9 Kyle M Hall 2016-11-15 15:54:54 UTC
(In reply to Jonathan Druart from comment #8)
> Created attachment 57506 [details] [review] [review]
> Bug 17599: Make the tests pass
> 
> If you run TooMany or MultiplePerRecord.t after
> t/db_dependent/Circulation/Returns.t (for instance) and that you are
> running memcached, item-level_itypes will be 0.
> These tests assume that the pref is 1

Followup pushed to master for 16.11, thanks Jonathan!
Comment 10 Jonathan Druart 2016-11-15 16:10:31 UTC
(In reply to Jonathan Druart from comment #8)
> Created attachment 57506 [details] [review] [review]
> Bug 17599: Make the tests pass

See bug 17633 for a complete fix.
Comment 11 Jonathan Druart 2016-12-05 12:47:43 UTC
*** Bug 17591 has been marked as a duplicate of this bug. ***