Go to file
Jonathan Druart d0040dff9f
Bug 23079: Handle invalid timezones when adding/subtracting durations
On Nov 3rd 2019, Brazil will skip from 00:00 to 1:00 (http://www.currenttimeonline.com/dst/dst.do?tz=America/Sao_Paulo), DateTime consider it as an invalid date.
It is a problem when we are playing with dates without the time part (always 00:00).
When we instantiate a DateTime (from dt_from_string) we are already handling this issue, and use the floating timezone (since bug 12669).

The problem remains when we generate a DateTime then add or subtract a duration, which will result in an invalid date:

DateTime->new(year => 2019, month => 12, day => 3, time_zone => 'America/Sao_Paulo')->subtract(days => 30);

=> Nov 3rd 2019, kaboom.

We should replace all the problematic occurrences of dt_from_string->subtract (or ->add)
with dt_from_string(undef, undef, 'floating'), to use the floating timezone and avoid the error.

Actually there are not many of them, I have found only 3 that could
produce real problems.

The other occurrences are:
- in tests => Not a big deal (for now)
- called on a datetime, so it will explode if called at midnight
00:00:00 (and nobody should work at that time).

Test plan:
0/ Define the timezone to 'America/Sao_Paulo' (in your koha-conf.xml file), restart_all
1/ Set a patron's expiry date to Dec 3rd 2019, and
NotifyBorrowerDeparture to 30 (default value)
2/ See the checkouts page for this user
=> Without this patch you get "Invalid local time for date in time zone:
America/Sao_Paulo"
=> With this patch apply the page displays correctly

QA will review the 2 other occurrences.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-09-06 13:17:47 +01:00
C4 Bug 14570: Make it possible to add multiple guarantors to a record 2019-08-20 16:04:48 +01:00
Koha Bug 23079: Handle invalid timezones when adding/subtracting durations 2019-09-06 13:17:47 +01:00
OpenILS
…
acqui Bug 23079: Handle invalid timezones when adding/subtracting durations 2019-09-06 13:17:47 +01:00
admin Bug 22786: Prevent fund creation for locked budgets 2019-09-06 13:17:47 +01:00
api/v1 Bug 14570: Make it possible to add multiple guarantors to a record 2019-08-20 16:04:48 +01:00
authorities Bug 19994: Used Modern::Perl in Authorities perl scripts 2019-01-28 14:58:23 +00:00
basket Bug 11529: Add templates for biblio title display. Unify display. 2019-08-05 15:03:19 +01:00
catalogue Bug 11529: (follow-up) Fix QA issues 2019-08-05 15:03:19 +01:00
cataloguing Bug 22830: correct for loop in value_builder/unimarc_field_4XX.pl value_builder 2019-08-16 11:42:54 +01:00
circ Bug 23273: Remove debug statement 2019-09-06 10:18:57 +01:00
clubs
…
course_reserves Bug 21003: Removed warning and changed wording on add_items-step2.tt 2019-03-23 09:51:36 +00:00
debian Bug 23345: Rename include-indexes to exclude-indexes in koha-dump 2019-07-26 16:23:03 +01:00
docs Bug 22128: Add Rudolf Byker to contributors 2019-06-28 14:34:05 +01:00
errors
…
etc Bug 20954: (QA follow-up) Rename syspref-overrides to syspref_overrides to maintain existing convention 2019-08-13 11:48:12 +01:00
ill Bug 21460: (follow-up) Fix bugs found in QA 2019-04-25 10:46:56 +00:00
installer Bug 22258: DBRev 19.06.023 2019-09-06 13:17:45 +01:00
koha-tmpl Bug 22786: Prevent fund creation for locked budgets 2019-09-06 13:17:47 +01:00
labels Bug 21206: Replace C4::Items::GetItem 2019-02-26 13:24:07 +00:00
members Bug 14570: Remove wrong parameter in add_guarantor call 2019-08-20 16:06:06 +01:00
misc Bug 14570: (follow-up) fix table name in j2a.pl 2019-08-20 16:05:08 +01:00
offline_circ Bug 22600: Add 'interface' to accountlines 2019-04-10 19:43:11 +00:00
opac Bug 14570: (QA follow-up) Call Koha::Patron->find in scalar context 2019-08-20 16:06:31 +01:00
patron_lists
…
patroncards Bug 21719: Fix typos 2018-11-08 02:18:46 +00:00
plugins Bug 21073: (QA follow-up) Avoid unnecessary unless/else construct 2019-06-18 17:30:44 +01:00
reports Bug 23390: (follow-up) Quote aliases 2019-08-13 11:46:35 +01:00
reserve Bug 11529: Add templates for biblio title display. Unify display. 2019-08-05 15:03:19 +01:00
reviews
…
rotating_collections
…
serials Bug 11529: Add templates for biblio title display. Unify display. 2019-08-05 15:03:19 +01:00
services
…
skel
…
suggestion Bug 22905: (QA follow-up) remove bad warn 2019-05-23 14:41:14 +00:00
svc Bug 23390: Introduce placeholder syntax for report column names 2019-08-13 11:46:06 +01:00
t Bug 22258: Elasticsearch: Add array as an alternative MARC format 2019-09-06 12:53:46 +01:00
tags Bug 11529: Add templates for biblio title display. Unify display. 2019-08-05 15:03:19 +01:00
tmp/modified_authorities
…
tools Bug 14570: Make it possible to add multiple guarantors to a record 2019-08-20 16:04:48 +01:00
virtualshelves Bug 11529: Add templates for biblio title display. Unify display. 2019-08-05 15:03:19 +01:00
xt Bug 21576: Keep compatibility with QA script 2018-10-26 17:09:52 +00:00
.editorconfig
…
.gitignore
…
.htaccess
…
.mailmap
…
.scss-lint.yml
…
INSTALL
…
Koha.pm Bug 22258: DBRev 19.06.023 2019-09-06 13:17:45 +01:00
LICENSE
…
MANIFEST.SKIP
…
Makefile.PL Bug 21626: (QA follow-up) Embed teams.yaml for debian packages 2019-05-17 14:46:10 +00:00
README
…
README.md
…
README.robots
…
about.pl Bug 14570: Add about.pl entry for wrong relationship data 2019-08-20 16:06:36 +01:00
changelanguage.pl Bug 21299: (QA follow-up) Rename module and subroutine 2018-11-07 21:52:17 +00:00
fix-perl-path.PL
…
gulpfile.js Bug 21751: Replace fixFloat with HC-sticky to fix Chrome display 2019-02-04 14:13:35 +00:00
help.pl
…
koha_perl_deps.pl
…
kohaversion.pl
…
mainpage.pl Bug 21907: Fix article requests count for non-superlibrarians 2019-02-04 14:50:40 +00:00
package.json
…
rewrite-config.PL
…
yarn.lock
…

README.md

Koha is a free software integrated library system (ILS).

Koha is distributed under the GNU GPL version 3 or later.

Note: This is a synced mirror of the official Koha repo.

Note: Koha does not accept pull requests from git hosting sites.

Note: This project has its own bug tracker, to report a bug or submit a patch visit http://bugs.koha-community.org.

For guidelines on submitting patches for Koha please visit https://wiki.koha-community.org/wiki/SubmitingAPatch

The developers handbook can be found at https://wiki.koha-community.org/wiki/Developer_handbook

http://koha-community.org/

Koha Logo