Bug 8640 - GetHardDueDate functions incorrectly
Summary: GetHardDueDate functions incorrectly
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Circulation (show other bugs)
Version: 3.8
Hardware: All All
: P5 - low normal
Assignee: Kyle M Hall
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-14 17:16 UTC by Kyle M Hall (khall)
Modified: 2013-12-05 19:59 UTC (History)
7 users (show)

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


Attachments
Bug 8640 - GetHardDueDate functions incorrectly (3.80 KB, patch)
2012-08-14 17:18 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 8640 - GetHardDueDate functions incorrectly (3.87 KB, patch)
2012-08-16 10:15 UTC, Julian Maurice
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Kyle M Hall (khall) 2012-08-14 17:16:11 UTC
GetHardDueDate works just like GetIssuingRule, but it not only tests for having
found an row of results before returning, but checks for the existence of a
hard due date as well. That means that even if it finds a matching rule, unless
that rule has a hardduedate set it will toss it and keep looking!

So, for example, even though there is a matching rule for say "STAFF / VIDEO / *", but it has no hardduedate. So it gets tossed and the subroutine keeps looking. If the next match, "STAFF / * / *" *has* a hardduedate, it is the one returned.

This means that if a more specific rule has no hard due date, it is overridden by a less specific rule that does have a hard due date.

TEST PLAN:
1) Create 2 issuing rules, one more specific with no hard due date, one less specific *with* a hard due date. See my description above for an example.
2) Issue an item to a borrower where the more specific rule should apply, and the checkout should not receive a hard due it.
3) Observe that it *does* receive a hard due date.
4) Apply the patch, and repeat step 2.
5) Observe that the checkout *does not* receive a hard due date.
Comment 1 Kyle M Hall (khall) 2012-08-14 17:18:03 UTC Comment hidden (obsolete)
Comment 2 Julian Maurice 2012-08-16 10:15:00 UTC
Created attachment 11636 [details] [review]
[SIGNED-OFF] Bug 8640 - GetHardDueDate functions incorrectly

GetHardDueDate works just like GetIssuingRule, but it not only tests for having
found an row of results before returning, but checks for the existence of a
hard due date as well. That means that even if it finds a matching rule, unless
that rule has a hardduedate set it will toss it and keep looking!

So, for example, even though there is a matching rule for say "STAFF / VIDEO / *",
but it has no hardduedate. So it gets tossed and the subroutine keeps looking.
If the next match, "STAFF / * / *" *has* a hardduedate, it is the one returned.

This means that if a more specific rule has no hard due date,
it is overridden by a less specific rule that does have a hard due date.

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Comment 3 Julian Maurice 2012-08-16 10:15:42 UTC
I followed the test plan, and confirm that the problem exists in master and is resolved by this patch.
Comment 4 Julian Maurice 2012-08-16 10:17:11 UTC
This is not an enhancement.
Increased severity to 'normal'
Comment 5 Ian Walls 2012-08-17 15:01:56 UTC
Fixes an insidious error with GetHardDueDate.  Marking Passed QA.
Comment 6 Paul Poulain 2012-08-29 16:14:08 UTC
Patch pushed to master
Comment 7 Chris Cormack 2012-08-29 22:05:38 UTC
Pushed to 3.8.x will be in 3.8.5