Bug 27676: Correct finesMode ne off condition
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Thu, 11 Feb 2021 10:21:43 +0000 (11:21 +0100)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Fri, 12 Feb 2021 11:14:50 +0000 (12:14 +0100)
commitf831130525c62f799c831dd7eb1b36065b60c172
treeb6a6af003c9be90d096eb69e31a2ca80832bb313
parentaa178bcf6a31cc4335fe417c89d85bc94f279667
Bug 27676: Correct finesMode ne off condition

finesMode is 'off' by default (sysprefs.sql), but if you modify its value from
the UI and set it to 'production' then back to 'off', the DB value becomes an
empty string '', because of $YAML::Syck::ImplicitTyping

This has been found when working on on removing YAML::Syck (bug 22824),
so it's not perfect but the situation will be cleared in the follow-up
bug report.

Test plan:
0. Don't apply the patch
1. reset_all
=> finesMode eq 'off' in DB
2. Set the pref's value to production
3. Switch it back to 'off'
4. Value is '' in DB
5. Check an item in that should generate overdue charges
=> Charges are not generated
6. Apply the patch
7. Check an item in that should generate overdue charges
=> Charges are generated

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
circ/returns.pl