From 289e82d73ba47c70cde10e29f68a7beaac07a47a Mon Sep 17 00:00:00 2001 From: ccheng Date: Mon, 10 Feb 2025 07:27:49 +0100 Subject: [PATCH] fix(GDPR/Update): set default value for self service fields in db --- tine20/GDPR/Setup/Update/18.php | 22 ++++++++++++++++++++++ tine20/GDPR/Setup/setup.xml | 2 +- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/tine20/GDPR/Setup/Update/18.php b/tine20/GDPR/Setup/Update/18.php index 6a0733325a3..5e3767a6db5 100644 --- a/tine20/GDPR/Setup/Update/18.php +++ b/tine20/GDPR/Setup/Update/18.php @@ -14,6 +14,7 @@ class GDPR_Setup_Update_18 extends Setup_Update_Abstract { protected const RELEASE018_UPDATE000 = __CLASS__ . '::update000'; + protected const RELEASE018_UPDATE001 = __CLASS__ . '::update001'; static protected $_allUpdates = [ self::PRIO_NORMAL_APP_UPDATE => [ @@ -21,6 +22,10 @@ class GDPR_Setup_Update_18 extends Setup_Update_Abstract self::CLASS_CONST => self::class, self::FUNCTION_CONST => 'update000', ], + self::RELEASE018_UPDATE001 => [ + self::CLASS_CONST => self::class, + self::FUNCTION_CONST => 'update001', + ], ], ]; @@ -28,4 +33,21 @@ public function update000(): void { $this->addApplicationUpdate(GDPR_Config::APP_NAME, '18.0', self::RELEASE018_UPDATE000); } + + public function update001(): void + { + Tinebase_TransactionManager::getInstance()->rollBack(); + + $this->getDb()->update( + SQL_TABLE_PREFIX . GDPR_Model_DataIntendedPurpose::TABLE_NAME, + [GDPR_Model_DataIntendedPurpose::FLD_IS_SELF_REGISTRATION => 0], + '`is_self_registration` is null' + ); + $this->getDb()->update( + SQL_TABLE_PREFIX . GDPR_Model_DataIntendedPurpose::TABLE_NAME, + [GDPR_Model_DataIntendedPurpose::FLD_IS_SELF_SERVICE => 0], + '`is_self_service` is null' + ); + $this->addApplicationUpdate(GDPR_Config::APP_NAME, '18.1', self::RELEASE018_UPDATE001); + } } diff --git a/tine20/GDPR/Setup/setup.xml b/tine20/GDPR/Setup/setup.xml index 876767b1da3..dd298919a71 100644 --- a/tine20/GDPR/Setup/setup.xml +++ b/tine20/GDPR/Setup/setup.xml @@ -1,7 +1,7 @@ GDPR - 18.0 + 18.1 80 CoreData