Bug 13104 - Changing date or time format on a production server will create duplicate fines!
Summary: Changing date or time format on a production server will create duplicate fines!
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Circulation (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low major (vote)
Assignee: Kyle M Hall
QA Contact: Testopia
URL:
Keywords:
: 12188 (view as bug list)
Depends on:
Blocks: 28598
  Show dependency treegraph
 
Reported: 2014-10-17 14:03 UTC by Kyle M Hall
Modified: 2021-06-18 13:11 UTC (History)
6 users (show)

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


Attachments
Bug 13104 - Changing TimeFormat on a production server will create duplicate fines! (2.07 KB, patch)
2014-10-17 14:06 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 13104 - Changing date or time format on a production server will create duplicate fines! (2.47 KB, patch)
2014-10-17 17:04 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 13104 - Changing date or time format on a production server will create duplicate fines! (2.54 KB, patch)
2014-10-19 06:47 UTC, Chris Cormack
Details | Diff | Splinter Review
[PASSED QA] Bug 13104 - Changing date or time format on a production server will create duplicate fines! (2.70 KB, patch)
2014-10-21 22:49 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 Kyle M Hall 2014-10-17 14:03:19 UTC
The system preference TimeFormat decides if times are formatted in 24 hour or 12 hour format. The issue at hand is that this changes the time description for fines. Let us assume the time format is currently 24 hour, and there are overdue items with accruing fines. When the format is changed to 12 hour, and fines.pl is run, it will begin looking for fines with a 12 hour format. Since there are no, it will create a new fine and you will now have two fines for the same item!

There are solutions which require database manipulation:
1) Update all existing fines from 24 hour to 12 hour format
2) Delete all existing accruing fines so they are all regenerated the following night

The accounts rewrite ( Bug 6427 ) will resolve this issue, as it does not look for existing fines based on the description.

I believe the best course of action until bug 6427 is pushed to master is to add a warning to the system preference to not alter it on a production server with existing fines.
Comment 1 Kyle M Hall 2014-10-17 14:06:39 UTC Comment hidden (obsolete)
Comment 2 Kyle M Hall 2014-10-17 17:01:49 UTC
When I filed the patch, I did not think about the fact that DateFormat has the same effect.
Comment 3 Kyle M Hall 2014-10-17 17:04:36 UTC Comment hidden (obsolete)
Comment 4 Chris Cormack 2014-10-19 06:47:18 UTC Comment hidden (obsolete)
Comment 5 Katrin Fischer 2014-10-21 22:49:30 UTC
Created attachment 32573 [details] [review]
[PASSED QA] Bug 13104 - Changing date or time format on a production server will create duplicate fines!

The system preference TimeFormat decides if times are formatted in 24
hour or 12 hour format. The issue at hand is that this changes the time
description for fines. Let us assume the time format is currently 24
hour, and there are overdue items with accruing fines. When the format
is changed to 12 hour, and fines.pl is run, it will begin looking for
fines with a 12 hour format. Since there are no, it will create a new
fine and you will now have two fines for the same item!

There are solutions which require database manipulation:
1) Update all existing fines from 24 hour to 12 hour format
2) Delete all existing accruing fines so they are all regenerated the
following night

The same situation applies to DateFormat.

The accounts rewrite ( Bug 6427 ) will resolve this issue, as it does
not look for existing fines based on the description.

I believe the best course of action until bug 6427 is pushed to master
is to add a warning to the system preference to not alter it on a
production server with existing fines.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Adds some documentation to warn about the problem.
Tested the new addition shows up in po files.
Comment 6 Tomás Cohen Arazi 2014-10-22 17:31:49 UTC
Patch pushed to master.

Thanks Kyle!
Comment 7 Katrin Fischer 2015-01-06 23:33:03 UTC
*** Bug 12188 has been marked as a duplicate of this bug. ***
Comment 8 Marc Véron 2016-08-22 07:43:59 UTC
Is the following warning for syspref "dateformat" still valid? 
("Do not change this preference on a production server with overdue items that are accruing fines. Doing so will result in duplicate fines!")
Comment 9 Jacek Ablewicz 2016-08-22 09:27:45 UTC
(In reply to Marc Véron from comment #8)
> Is the following warning for syspref "dateformat" still valid? 
> ("Do not change this preference on a production server with overdue items
> that are accruing fines. Doing so will result in duplicate fines!")

No longer valid for both preferences (dateformat, TimeFormat) since 16.05. Still valid in 3.22 (oldstable).

Changing the format[s] in production 16.05+ would not affect the existing fines descriptions though (nor the entries in actionlogs, ...) so such changes may cause some inconsistencies in fines descriptions display; fines created after the syspref changes will have time/date part in description formatted differently.