From d071a643001dcb8459ae1c0fc5f0d9ecf3b4dfe1 Mon Sep 17 00:00:00 2001 From: Seamus Lee Date: Mon, 20 Jul 2020 11:42:23 +1000 Subject: [PATCH] Update version in the test_data_second_domain file and also update the setVersion script to update the file version as necessary Set setting indicating system has been installed after loading in the 2nd domain --- Civi/Test/Data.php | 2 ++ sql/test_data_second_domain.mysql | 2 +- tools/bin/scripts/set-version.php | 6 +++++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Civi/Test/Data.php b/Civi/Test/Data.php index 9360484f29..d2007f9e82 100644 --- a/Civi/Test/Data.php +++ b/Civi/Test/Data.php @@ -44,6 +44,8 @@ class Data { \Civi\Test::schema()->setStrict(TRUE); }); + civicrm_api('setting', 'create', ['installed' => 1, 'domain_id' => 'all', 'version' => 3]); + // Rebuild triggers civicrm_api('system', 'flush', ['version' => 3, 'triggers' => 1]); diff --git a/sql/test_data_second_domain.mysql b/sql/test_data_second_domain.mysql index a0cf296334..5aac2acc1b 100644 --- a/sql/test_data_second_domain.mysql +++ b/sql/test_data_second_domain.mysql @@ -963,4 +963,4 @@ INSERT INTO civicrm_navigation VALUES ( @domainID, CONCAT('civicrm/report/instance/', @instanceID,'&reset=1'), 'Mailing Detail Report', 'Mailing Detail Report', 'administer CiviMail', 'OR', @reportlastID, '1', NULL, @instanceID+2 ); UPDATE civicrm_report_instance SET navigation_id = LAST_INSERT_ID() WHERE id = @instanceID; -UPDATE civicrm_domain SET version = '5.28.alpha1'; +UPDATE civicrm_domain SET version = '5.29.alpha1'; diff --git a/tools/bin/scripts/set-version.php b/tools/bin/scripts/set-version.php index 4b7a6d6071..1918e4e4bb 100755 --- a/tools/bin/scripts/set-version.php +++ b/tools/bin/scripts/set-version.php @@ -71,8 +71,12 @@ updateFile("sql/civicrm_generated.mysql", function ($content) use ($newVersion, return str_replace($oldVersion, $newVersion, $content); }); +updateFile("sql/test_data_second_domain.mysql", function ($content) use ($newVersion, $oldVersion) { + return str_replace($oldVersion, $newVersion, $content); +}); + if ($doCommit) { - $files = "xml/version.xml sql/civicrm_generated.mysql " . escapeshellarg($phpFile) . ' ' . escapeshellarg($sqlFile); + $files = "xml/version.xml sql/civicrm_generated.mysql sql/test_data_second_domain.mysql " . escapeshellarg($phpFile) . ' ' . escapeshellarg($sqlFile); passthru("git add $files"); passthru("git commit $files -m " . escapeshellarg("Set version to $newVersion")); } -- 2.25.1