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.
Created attachment 32499 [details] [review] Bug 13104 - Changing TimeFormat 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 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.
When I filed the patch, I did not think about the fact that DateFormat has the same effect.
Created attachment 32519 [details] [review] 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.
Created attachment 32521 [details] [review] 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>
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.
Patch pushed to master. Thanks Kyle!
*** Bug 12188 has been marked as a duplicate of this bug. ***
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!")
(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.