diff --git a/CRM/Upgrade/Incremental/php/SixZero.php b/CRM/Upgrade/Incremental/php/SixZero.php index be0590fc74b8..95d7ddb9430f 100644 --- a/CRM/Upgrade/Incremental/php/SixZero.php +++ b/CRM/Upgrade/Incremental/php/SixZero.php @@ -38,6 +38,8 @@ 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']); } /** @@ -69,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..346ed13eabbb 100644 --- a/Civi/Core/Themes.php +++ b/Civi/Core/Themes.php @@ -22,10 +22,10 @@ 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 = 'greenwich'; + const DEFAULT_THEME = 'minetta'; /** * Fallback is a pseudotheme which can be included in "search_order". @@ -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)'), 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] 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'; });