[koha-commits] main Koha release repository branch 3.20.x updated. v3.20.02-4-g7abf1d9
Git repo owner
gitmaster at git.koha-community.org
Wed Jul 29 22:57:27 CEST 2015
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "main Koha release repository".
The branch, 3.20.x has been updated
via 7abf1d9a184dd7cc2805f05e921a883871092b33 (commit)
via 58b5b915a0ba4c86639a260b53dd0ad89320ec36 (commit)
via 03a110b637343111d0906db557d2179a14857a92 (commit)
via 7eb7b6d90caeeb65fc930c34bc3f0f28603bedd9 (commit)
from cede10ef4b43b69c8c9a0573e73b8c86854a8d99 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 7abf1d9a184dd7cc2805f05e921a883871092b33
Author: Marcel de Rooy <m.de.rooy at rijksmuseum.nl>
Date: Thu Jul 9 15:35:53 2015 +0200
Bug 14494: Add some unit tests too for CalcDateDue
The second patch of this report made some changes to CalcDateDue.
We are adding some unit tests here.
See the commments on the third patch too.
Test plan:
Run t/db_dependent/Circulation_dateexpiry.t
Signed-off-by: Jonathan Druart <jonathan.druart at bugs.koha-community.org>
Amended patch: Set the number of tests for the second subtest (was
commented) and perltidy the second block.
Signed-off-by: Kyle M Hall <kyle at bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen at unc.edu.ar>
(cherry picked from commit 1a8962f306d2d2f0c7789c649aa615192ccd5ca1)
Signed-off-by: Chris Cormack <chrisc at catalyst.net.nz>
commit 58b5b915a0ba4c86639a260b53dd0ad89320ec36
Author: Jonathan Druart <jonathan.druart at koha-community.org>
Date: Thu Jul 9 09:52:28 2015 +0100
Bug 14494: Unit tests for CanBookBeIssued related to dateexpiry
Signed-off-by: Marcel de Rooy <m.de.rooy at rijksmuseum.nl>
Moved the test on its own. Nicer than adding TestBuilder in the final part
of the test. No warnings/errors from TestBuilder, no dependency..
Signed-off-by: Jonathan Druart <jonathan.druart at bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle at bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen at unc.edu.ar>
(cherry picked from commit e0986f5a796b24d6fec00d849f7c71caf0dd5640)
Signed-off-by: Chris Cormack <chrisc at catalyst.net.nz>
commit 03a110b637343111d0906db557d2179a14857a92
Author: Marcel de Rooy <m.de.rooy at rijksmuseum.nl>
Date: Mon Jul 6 14:20:07 2015 +0200
Bug 14494: Terribly slow checkout caused by DateTime->new in far future
An expiry date like 9999-12-31 in the local timezone will make DateTime
spend a lot of time (maybe 60 seconds) on date calculation. See the
DateTime documention on CPAN.
A calculation in floating (or alternatively in UTC) would only take
a few milliseconds.
This patch makes two changes in this regard:
[1] The compare between expiry date and today in CanBookBeIssued has been
adjusted in Jonathan's patch. I am moving the compare to the floating
timezone (as was done in my original patch). This removes a hardcoded
9999.
[2] If ReturnBeforeExpiry is enabled, CalcDateDue compares the normal due
date with the expiry date. The comparison is now done in the floating
timezone. If the expiry date is before the due date, it is
returned in the user context's timezone.
NOTE: The calls to set_time_zone moving to or from floating do not adjust
the local time.
TEST PLAN:
First without this patch (and the one from Jonathan):
[1] Set expiry date to 9999-12-31 for a patron.
[2] Enable ReturnBeforeExpiry.
[3] Checkout a book to this patron. This will be (very) slow.
Continue now with this patch applied:
[4] Check in the same book.
[5] Check it out again. Should be much faster.
Bonus test:
[6] Set borrower expiry date to today. Change relevant circulation rule
to loan period of 21 hours. Test checking out with a manual due date
/time just before today 23:59 and after that. In the second case the
due date/time should become today 23:59 (note that 23:59 is not
shown on the checkout form).
Signed-off-by: Jonathan Druart <jonathan.druart at bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle at bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen at unc.edu.ar>
(cherry picked from commit 17d04c46190880d3031adbc02553f82234d70fc1)
Signed-off-by: Chris Cormack <chrisc at catalyst.net.nz>
commit 7eb7b6d90caeeb65fc930c34bc3f0f28603bedd9
Author: Jonathan Druart <jonathan.druart at koha-community.org>
Date: Thu Jul 9 09:52:28 2015 +0100
Bug 14494: Prevent slow checkout if the patron does not have an expiry date
If a patron has a expiry date set to 9999-12-31 (for organizations for
instance), the checkouts are very slow.
It's caused by 2 different calls to DateTime in CanBookBeIssued:
1/
DateTime->new( year => 9999, month => 12, day => 31, time_zone => C4::Context->tz );
The time_zone should not be set (as it's done in Koha::DateUtils), set to UTC or floating tz.
2/
DateTime->compare($today, $expiry_dt)
The comparaison of 2 DT with 1 related to 9999 is very slow, as you can
imagine.
For 1/ we need to call Koha::DateUtils::dt_from_string (actually, we
should never call DateTime directly).
For 2/ we just need to test if the date is != 9999, no need to compare
it in this case.
Test plan:
Before this patch, confirm that the checkouts are slow if the patron has a
dateexpiry set to 9999-12-31.
update borrowers set dateexpiry="9999-12-31" where borrowernumber=42;
After this patch, you should not see any regression when checking out
items to an expired patron and to a valid patron.
Signed-off-by: Marcel de Rooy <m.de.rooy at rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart at bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle at bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen at unc.edu.ar>
(cherry picked from commit 8d58acc565c8500d4b9d55cacb3d6d21628a899b)
Signed-off-by: Chris Cormack <chrisc at catalyst.net.nz>
-----------------------------------------------------------------------
Summary of changes:
C4/Circulation.pm | 32 ++++-----
t/db_dependent/Circulation_dateexpiry.t | 111 +++++++++++++++++++++++++++++++
2 files changed, 124 insertions(+), 19 deletions(-)
create mode 100644 t/db_dependent/Circulation_dateexpiry.t
hooks/post-receive
--
main Koha release repository
More information about the koha-commits
mailing list