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
Created attachment 116700 [details] [review] 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
Created attachment 116719 [details] [review] 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>
Good catch! I've checked other occurrences of finesMode and none of them fail in this way. Simple, trivial, patch that works as expected. Going straight for QA here. Passed.
Pushed to master for 21.05, thanks to everybody involved!
Pushed to 20.11.x for 20.11.03
Correcting a typo in the test plan (charge behavior was backwards between 5 and 7): 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 generated 6. Apply the patch 7. Check an item in that should generate overdue charges => Charges are not generated
Pushed to 20.05.x for 20.05.09
Backported: Pushed to 19.11.x branch for 19.11.15