Bug 22044: Set default and add NoRenewalBeforePrecision preference for new/affected installs

I am not sure the correct answer - for upgraded installs the pref was
set to date, which changed behaviour

For new installs the pref was unset, behaved as if 'exact_time' so we
shouldn't change behaviour?

If the perceived default is date then the code should be changed, or
this shouldn't be a pref at all?

To test:
1 - Have a new system missing this pref
2 - Note when searchign the pref in staff client if appears as 'date'
3 - Check the db to confirm value is 'NULL'
4 - Apply patch and run update
5 - Pref is now set to 'exact_time'

Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
This commit is contained in:
Nick Clemens 2018-12-21 19:19:05 +00:00
parent 9f34d208d0
commit 4779cf8450
2 changed files with 11 additions and 0 deletions

View file

@ -0,0 +1,10 @@
$DBversion = 'XXX';
if( CheckVersion( $DBversion ) ) {
$dbh->do( q{
INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type)
VALUES ('NoRenewalBeforePrecision', 'exact_time', 'Calculate "No renewal before" based on date or exact time. Only relevant for loans calculated in days, hourly loans are not affected.', 'date|exact_time', 'Choice');
});
$dbh->do("UPDATE systempreferences SET value='exact_time' WHERE variable='NoRenewalBeforePrecision' AND value IS NULL;" );
SetVersion( $DBversion );
print "Upgrade to $DBversion done (Bug 22044 - Set a default value for NoRenewalBeforePrecision)\n";
}

View file

@ -312,6 +312,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `
('noissuescharge','5','','Define maximum amount withstanding before check outs are blocked','Integer'),
('NoIssuesChargeGuarantees','','','Define maximum amount withstanding before check outs are blocked','Integer'),
('noItemTypeImages','0',NULL,'If ON, disables item-type images','YesNo'),
('NoRenewalBefore','exact_time','date|exact_time','Calculate NoRenewalBefore based on date only or exact time of due date','Choice'),
('NotesBlacklist','',NULL,'List of notes fields that should not appear in the title notes/description separator of details','free'),
('NotHighlightedWords','and|or|not',NULL,'List of words to NOT highlight when OpacHitHighlight is enabled','free'),
('NoticeBcc','','','Email address to bcc outgoing notices sent by email','free'),