diff --git a/core/modules/system/lib/Drupal/system/Tests/System/ThemeTest.php b/core/modules/system/lib/Drupal/system/Tests/System/ThemeTest.php index 111e6b7..e965bc9 100644 --- a/core/modules/system/lib/Drupal/system/Tests/System/ThemeTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/System/ThemeTest.php @@ -242,11 +242,14 @@ function testSwitchDefaultTheme() { /** * Test that themes can't be enabled when the base theme or engine is missing. + * Include test for themes that have a missing base theme somewhere further up + * the chain than the immediate base theme. */ function testInvalidTheme() { module_enable(array('theme_page_test')); $this->drupalGet('admin/appearance'); $this->assertText(t('This theme requires the base theme @base_theme to operate correctly.', array('@base_theme' => 'not_real_test_basetheme')), 'Invalid base theme check succeeded.'); + $this->assertText(t('This theme requires the base theme @base_theme to operate correctly.', array('@base_theme' => 'test_invalid_basetheme')), 'Invalid non-immediate base theme check succeeded.'); $this->assertText(t('This theme requires the theme engine @theme_engine to operate correctly.', array('@theme_engine' => 'not_real_engine')), 'Invalid theme engine check succeeded.'); } } diff --git a/core/modules/system/system.admin.inc b/core/modules/system/system.admin.inc index c3c2ce4..cad498b 100644 --- a/core/modules/system/system.admin.inc +++ b/core/modules/system/system.admin.inc @@ -157,8 +157,8 @@ function system_themes_page() { // content has a common place in all themes. $theme->incompatible_core = !isset($theme->info['core']) || ($theme->info['core'] != DRUPAL_CORE_COMPATIBILITY) || (!isset($theme->info['regions']['content'])); $theme->incompatible_php = version_compare(phpversion(), $theme->info['php']) < 0; - // Confirmed that the base theme is available. - $theme->incompatible_base = (isset($theme->info['base theme']) && !isset($themes[$theme->info['base theme']])); + // Confirm that all base themes are available. + $theme->incompatible_base = (isset($theme->info['base theme']) && !($theme->base_themes === array_filter($theme->base_themes))); // Confirm that the theme engine is available. $theme->incompatible_engine = (isset($theme->info['engine']) && !isset($theme->owner)); } diff --git a/core/modules/system/tests/modules/theme_page_test/theme_page_test.module b/core/modules/system/tests/modules/theme_page_test/theme_page_test.module index 63f8cb4..9ffbf31 100644 --- a/core/modules/system/tests/modules/theme_page_test/theme_page_test.module +++ b/core/modules/system/tests/modules/theme_page_test/theme_page_test.module @@ -16,6 +16,7 @@ function theme_page_test_system_info_alter(&$info, $file, $type) { */ function theme_page_test_system_theme_info() { $themes['test_invalid_basetheme'] = drupal_get_path('module', 'system') . '/tests/themes/test_invalid_basetheme/test_invalid_basetheme.info'; + $themes['test_invalid_basetheme_sub'] = drupal_get_path('module', 'system') . '/tests/themes/test_invalid_basetheme/test_invalid_basetheme_sub.info'; $themes['test_invalid_engine'] = drupal_get_path('module', 'system') . '/tests/themes/test_invalid_engine/test_invalid_engine.info'; return $themes; } diff --git a/core/modules/system/tests/themes/test_invalid_basetheme/test_invalid_basetheme_sub.info b/core/modules/system/tests/themes/test_invalid_basetheme/test_invalid_basetheme_sub.info new file mode 100644 index 0000000..8a26383 --- /dev/null +++ b/core/modules/system/tests/themes/test_invalid_basetheme/test_invalid_basetheme_sub.info @@ -0,0 +1,5 @@ +name = Theme test with valid base theme but no grandparent base theme +description = Test theme which has a non-existent base theme in the base chain. +core = 8.x +base theme = test_invalid_basetheme +hidden = TRUE