Loading core/modules/system/css/system.admin.css +4 −0 Original line number Diff line number Diff line Loading @@ -255,6 +255,10 @@ small .admin-link:after { .theme-info__description { margin-top: 0; } .theme-link--non-stable { padding-left: 18px; background: url(../../../misc/icons/e29700/warning.svg) 0 50% no-repeat; /* LTR */ } .system-themes-list { margin-bottom: 20px; } Loading core/modules/system/src/Controller/SystemController.php +19 −3 Original line number Diff line number Diff line Loading @@ -4,11 +4,13 @@ use Drupal\Core\Cache\CacheableMetadata; use Drupal\Core\Controller\ControllerBase; use Drupal\Core\Extension\ExtensionLifecycle; use Drupal\Core\Extension\ModuleDependencyMessageTrait; use Drupal\Core\Extension\ModuleExtensionList; use Drupal\Core\Extension\ThemeExtensionList; use Drupal\Core\Extension\ThemeHandlerInterface; use Drupal\Core\Form\FormBuilderInterface; use Drupal\Core\Link; use Drupal\Core\Menu\MenuLinkTreeInterface; use Drupal\Core\Menu\MenuTreeParameters; use Drupal\Core\Theme\ThemeAccessCheck; Loading Loading @@ -343,8 +345,7 @@ public function themesPage() { } } // Add notes to default theme, administration theme and experimental // themes. // Add notes to default theme, administration theme and non-stable themes. $theme->notes = []; if ($theme->is_default) { $theme->notes[] = $this->t('default theme'); Loading @@ -352,7 +353,22 @@ public function themesPage() { if ($theme->is_admin) { $theme->notes[] = $this->t('administration theme'); } if ($theme->isExperimental()) { $lifecycle = $theme->info[ExtensionLifecycle::LIFECYCLE_IDENTIFIER]; if (!empty($theme->info[ExtensionLifecycle::LIFECYCLE_LINK_IDENTIFIER])) { $theme->notes[] = Link::fromTextAndUrl($this->t('@lifecycle', ['@lifecycle' => ucfirst($lifecycle)]), Url::fromUri($theme->info[ExtensionLifecycle::LIFECYCLE_LINK_IDENTIFIER], [ 'attributes' => [ 'class' => 'theme-link--non-stable', 'aria-label' => $this->t('View information on the @lifecycle status of the theme @theme', [ '@lifecycle' => ucfirst($lifecycle), '@theme' => $theme->info['name'], ]), ], ]) )->toString(); } if ($theme->isExperimental() && empty($theme->info[ExtensionLifecycle::LIFECYCLE_LINK_IDENTIFIER])) { $theme->notes[] = $this->t('experimental theme'); } Loading core/modules/system/tests/src/Functional/System/ThemeTest.php +6 −0 Original line number Diff line number Diff line Loading @@ -288,6 +288,12 @@ public function testAdministrationTheme() { $this->drupalGet('admin/appearance'); $this->submitForm($edit, 'Save configuration'); // Check the display of non stable themes. $this->drupalGet('admin/appearance'); $this->assertSession()->pageTextContains('Experimental test 9.4.0-dev (experimental theme)'); $this->assertSession()->pageTextContains('Test deprecated theme 9.4.0-dev (Deprecated)'); $this->assertSession()->elementExists('xpath', "//a[contains(@href, 'http://example.com/deprecated_theme')]"); // Check that the administration theme is used on an administration page. $this->drupalGet('admin/config'); $this->assertSession()->responseContains('core/themes/seven'); Loading Loading
core/modules/system/css/system.admin.css +4 −0 Original line number Diff line number Diff line Loading @@ -255,6 +255,10 @@ small .admin-link:after { .theme-info__description { margin-top: 0; } .theme-link--non-stable { padding-left: 18px; background: url(../../../misc/icons/e29700/warning.svg) 0 50% no-repeat; /* LTR */ } .system-themes-list { margin-bottom: 20px; } Loading
core/modules/system/src/Controller/SystemController.php +19 −3 Original line number Diff line number Diff line Loading @@ -4,11 +4,13 @@ use Drupal\Core\Cache\CacheableMetadata; use Drupal\Core\Controller\ControllerBase; use Drupal\Core\Extension\ExtensionLifecycle; use Drupal\Core\Extension\ModuleDependencyMessageTrait; use Drupal\Core\Extension\ModuleExtensionList; use Drupal\Core\Extension\ThemeExtensionList; use Drupal\Core\Extension\ThemeHandlerInterface; use Drupal\Core\Form\FormBuilderInterface; use Drupal\Core\Link; use Drupal\Core\Menu\MenuLinkTreeInterface; use Drupal\Core\Menu\MenuTreeParameters; use Drupal\Core\Theme\ThemeAccessCheck; Loading Loading @@ -343,8 +345,7 @@ public function themesPage() { } } // Add notes to default theme, administration theme and experimental // themes. // Add notes to default theme, administration theme and non-stable themes. $theme->notes = []; if ($theme->is_default) { $theme->notes[] = $this->t('default theme'); Loading @@ -352,7 +353,22 @@ public function themesPage() { if ($theme->is_admin) { $theme->notes[] = $this->t('administration theme'); } if ($theme->isExperimental()) { $lifecycle = $theme->info[ExtensionLifecycle::LIFECYCLE_IDENTIFIER]; if (!empty($theme->info[ExtensionLifecycle::LIFECYCLE_LINK_IDENTIFIER])) { $theme->notes[] = Link::fromTextAndUrl($this->t('@lifecycle', ['@lifecycle' => ucfirst($lifecycle)]), Url::fromUri($theme->info[ExtensionLifecycle::LIFECYCLE_LINK_IDENTIFIER], [ 'attributes' => [ 'class' => 'theme-link--non-stable', 'aria-label' => $this->t('View information on the @lifecycle status of the theme @theme', [ '@lifecycle' => ucfirst($lifecycle), '@theme' => $theme->info['name'], ]), ], ]) )->toString(); } if ($theme->isExperimental() && empty($theme->info[ExtensionLifecycle::LIFECYCLE_LINK_IDENTIFIER])) { $theme->notes[] = $this->t('experimental theme'); } Loading
core/modules/system/tests/src/Functional/System/ThemeTest.php +6 −0 Original line number Diff line number Diff line Loading @@ -288,6 +288,12 @@ public function testAdministrationTheme() { $this->drupalGet('admin/appearance'); $this->submitForm($edit, 'Save configuration'); // Check the display of non stable themes. $this->drupalGet('admin/appearance'); $this->assertSession()->pageTextContains('Experimental test 9.4.0-dev (experimental theme)'); $this->assertSession()->pageTextContains('Test deprecated theme 9.4.0-dev (Deprecated)'); $this->assertSession()->elementExists('xpath', "//a[contains(@href, 'http://example.com/deprecated_theme')]"); // Check that the administration theme is used on an administration page. $this->drupalGet('admin/config'); $this->assertSession()->responseContains('core/themes/seven'); Loading