Skip to content

Commit

Permalink
Merge branch 'pu/ccheng/rt_240067' into 'main'
Browse files Browse the repository at this point in the history
fix(GDPR/Update): set default value for self service fields in db

See merge request tine20/tine20!6562
  • Loading branch information
pschuele committed Feb 10, 2025
2 parents a9913a0 + 289e82d commit 13dfed5
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
22 changes: 22 additions & 0 deletions tine20/GDPR/Setup/Update/18.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,40 @@
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 => [
self::RELEASE018_UPDATE000 => [
self::CLASS_CONST => self::class,
self::FUNCTION_CONST => 'update000',
],
self::RELEASE018_UPDATE001 => [
self::CLASS_CONST => self::class,
self::FUNCTION_CONST => 'update001',
],
],
];

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);
}
}
2 changes: 1 addition & 1 deletion tine20/GDPR/Setup/setup.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<application>
<name>GDPR</name>
<version>18.0</version>
<version>18.1</version>
<order>80</order>
<depends>
<application>CoreData</application>
Expand Down

0 comments on commit 13dfed5

Please sign in to comment.