From 17cd698b46e45aff36b1a28fc44b5c775f385b21 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Fri, 22 May 2020 14:49:06 +0100 Subject: [PATCH] Bug 24380: (RM follow-up) Fix update statement to prevent regression The update statement did not respect the original value of CalcalateFinesOnReturn and so would result in an unexpected functional change during upgrades. Signed-off-by: Martin Renvoize --- installer/data/mysql/updatedatabase.pl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 21572b5717..e2cffe9518 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -21631,8 +21631,9 @@ if( CheckVersion( $DBversion ) ) { $DBversion = '19.12.00.072'; if( CheckVersion( $DBversion ) ) { $dbh->do(q{ - INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES - ('CalculateFinesOnBackdate','1','','Switch to control if overdue fines are calculated on return when backdating','YesNo'); + INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) + SELECT 'CalculateFinesOnBackdate',value,'','Switch to control if overdue fines are calculated on return when backdating','YesNo' + FROM ( SELECT value FROM systempreferences WHERE variable = 'CalculateFinesOnReturn' ) tmp }); NewVersion( $DBversion, 24380, "Add syspref CalculateFinesOnBackdate"); -- 2.39.5