From b02421034d1b3a32dc8b52a3785370b74b6aca2a Mon Sep 17 00:00:00 2001 From: benjamin Date: Thu, 6 Feb 2025 16:51:53 +0000 Subject: [PATCH 1/5] Riverlea rollout - ensure Riverlea ext is enabled from 6.0 --- CRM/Upgrade/Incremental/php/SixZero.php | 1 + ext/riverlea/info.xml | 3 +++ setup/plugins/init/DefaultExtensions.civi-setup.php | 1 + 3 files changed, 5 insertions(+) diff --git a/CRM/Upgrade/Incremental/php/SixZero.php b/CRM/Upgrade/Incremental/php/SixZero.php index be0590fc74b8..4890fe3f39db 100644 --- a/CRM/Upgrade/Incremental/php/SixZero.php +++ b/CRM/Upgrade/Incremental/php/SixZero.php @@ -38,6 +38,7 @@ public function upgrade_6_0_alpha1($rev): void { FALSE ); $this->addTask('Set a default activity priority', 'addActivityPriorityDefault'); + $this->addExtensionTask('Enable Riverlea extension', ['riverlea']); } /** diff --git a/ext/riverlea/info.xml b/ext/riverlea/info.xml index cfee32c045f1..2c44e76a4589 100755 --- a/ext/riverlea/info.xml +++ b/ext/riverlea/info.xml @@ -17,6 +17,9 @@ [civicrm.majorVersion] + + mgmt:required + A cross-CMS CiviCRM theme framework. diff --git a/setup/plugins/init/DefaultExtensions.civi-setup.php b/setup/plugins/init/DefaultExtensions.civi-setup.php index fe7d6518f8f2..54505c5ae0c8 100644 --- a/setup/plugins/init/DefaultExtensions.civi-setup.php +++ b/setup/plugins/init/DefaultExtensions.civi-setup.php @@ -22,5 +22,6 @@ $e->getModel()->extensions[] = 'authx'; $e->getModel()->extensions[] = 'civiimport'; $e->getModel()->extensions[] = 'message_admin'; + $e->getModel()->extensions[] = 'riverlea'; }); From d477d97fdadca595c9fbbd55005f9c80f74efde8 Mon Sep 17 00:00:00 2001 From: benjamin Date: Thu, 6 Feb 2025 16:31:08 +0000 Subject: [PATCH 2/5] Riverlea rollout - set Minetta as default theme going forward, freeze on Greenwich for upgrading sites --- CRM/Upgrade/Incremental/php/SixZero.php | 22 ++++++++++++++++++++++ Civi/Core/Themes.php | 2 +- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/CRM/Upgrade/Incremental/php/SixZero.php b/CRM/Upgrade/Incremental/php/SixZero.php index 4890fe3f39db..95d7ddb9430f 100644 --- a/CRM/Upgrade/Incremental/php/SixZero.php +++ b/CRM/Upgrade/Incremental/php/SixZero.php @@ -38,6 +38,7 @@ public function upgrade_6_0_alpha1($rev): void { FALSE ); $this->addTask('Set a default activity priority', 'addActivityPriorityDefault'); + $this->addTask('Freeze theme choice to Greenwich', 'freezeDefaultThemeToGreenwich'); $this->addExtensionTask('Enable Riverlea extension', ['riverlea']); } @@ -70,4 +71,25 @@ public static function addActivityPriorityDefault() { return TRUE; } + /** + * On 6.0 the default theme changes to Riverlea. + * + * For sites upgrading that have not made an explicit theme choice and have previously got + * Greenwich by default, change this to an explicit choice of Greenwich. + * + * @return bool + */ + public static function freezeDefaultThemeToGreenwich() { + $themeSettings = ['theme_backend','theme_frontend']; + + foreach ($themeSettings as $key) { + $value = \Civi::settings()->get($key); + if ($value === 'default') { + \Civi::settings()->set($key, 'greenwich'); + } + } + + return TRUE; + } + } diff --git a/Civi/Core/Themes.php b/Civi/Core/Themes.php index 05469ba93710..7095d21490aa 100644 --- a/Civi/Core/Themes.php +++ b/Civi/Core/Themes.php @@ -25,7 +25,7 @@ class Themes extends \Civi\Core\Service\AutoService { * The "default" theme adapts based on the latest recommendation from civicrm.org * by switching to DEFAULT_THEME at runtime. */ - const DEFAULT_THEME = 'greenwich'; + const DEFAULT_THEME = 'minetta'; /** * Fallback is a pseudotheme which can be included in "search_order". From e4b222fd27014ac3b9d76ea32aff3dfb7738cf96 Mon Sep 17 00:00:00 2001 From: benjamin Date: Thu, 6 Feb 2025 16:36:35 +0000 Subject: [PATCH 3/5] Riverlea rollout - unhide Greenwich (can be disabled now) --- ext/greenwich/info.xml | 3 --- 1 file changed, 3 deletions(-) diff --git a/ext/greenwich/info.xml b/ext/greenwich/info.xml index 09b82eff3095..9bbea1b9b746 100644 --- a/ext/greenwich/info.xml +++ b/ext/greenwich/info.xml @@ -16,9 +16,6 @@ [civicrm.releaseDate] [civicrm.version] - - mgmt:hidden - stable [civicrm.majorVersion] From 6a1046c7cd65bdcc52a951d3a68d5d5c50895680 Mon Sep 17 00:00:00 2001 From: benjamin Date: Thu, 6 Feb 2025 16:44:11 +0000 Subject: [PATCH 4/5] Riverlea rollout - remove hardcoded Greenwich theme option --- Civi/Core/Themes.php | 5 ----- 1 file changed, 5 deletions(-) diff --git a/Civi/Core/Themes.php b/Civi/Core/Themes.php index 7095d21490aa..f2d79cb0ec23 100644 --- a/Civi/Core/Themes.php +++ b/Civi/Core/Themes.php @@ -202,11 +202,6 @@ protected function buildAll() { 'help' => ts('Determine a system default automatically'), // This is an alias. url_callback, search_order don't matter. ], - 'greenwich' => [ - 'ext' => 'civicrm', - 'title' => 'Greenwich', - 'help' => ts('CiviCRM 4.x look-and-feel'), - ], 'none' => [ 'ext' => 'civicrm', 'title' => ts('None (Unstyled)'), From 7f6521997bfeec48304a31275a08726a22ba6396 Mon Sep 17 00:00:00 2001 From: benjamin Date: Thu, 6 Feb 2025 16:31:27 +0000 Subject: [PATCH 5/5] update comment on Themes::DEFAULT_THEME - it doesnt check remotely --- Civi/Core/Themes.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Civi/Core/Themes.php b/Civi/Core/Themes.php index f2d79cb0ec23..346ed13eabbb 100644 --- a/Civi/Core/Themes.php +++ b/Civi/Core/Themes.php @@ -22,7 +22,7 @@ class Themes extends \Civi\Core\Service\AutoService { /** - * The "default" theme adapts based on the latest recommendation from civicrm.org + * The "default" theme adapts based on the latest recommendation * by switching to DEFAULT_THEME at runtime. */ const DEFAULT_THEME = 'minetta';