diff --git a/core/modules/ckeditor5/ckeditor5.module b/core/modules/ckeditor5/ckeditor5.module index d74926fa72..1b121e2805 100644 --- a/core/modules/ckeditor5/ckeditor5.module +++ b/core/modules/ckeditor5/ckeditor5.module @@ -358,8 +358,9 @@ function ckeditor5_library_info_alter(&$libraries, $extension) { $themes = []; $default_theme = \Drupal::configFactory()->get('system.theme')->get('default'); - $default_theme_info = \Drupal::service('theme_handler')->listInfo()[$default_theme]->info; - $themes[$default_theme] = $default_theme_info; + if (!empty($default_theme)) { + $themes[$default_theme] = \Drupal::service('theme_handler')->listInfo()[$default_theme]->info; + } $admin_theme = \Drupal::configFactory()->get('system.theme')->get('admin'); if (!empty($admin_theme) && $admin_theme !== $default_theme) { diff --git a/core/modules/ckeditor5/tests/src/FunctionalJavascript/CKEditorStylesheetsWarningTest.php b/core/modules/ckeditor5/tests/src/FunctionalJavascript/CKEditorStylesheetsWarningTest.php index 3ccd17841e..f55181dd61 100644 --- a/core/modules/ckeditor5/tests/src/FunctionalJavascript/CKEditorStylesheetsWarningTest.php +++ b/core/modules/ckeditor5/tests/src/FunctionalJavascript/CKEditorStylesheetsWarningTest.php @@ -34,10 +34,12 @@ public function testWarningFilterUI() { $assert_session = $this->assertSession(); $this->addNewTextFormat($page, $assert_session); $this->drupalGet('admin/config/content/formats/manage/ckeditor5'); - $this->assertFalse($assert_session->waitForText('Your default theme "test_ckeditor_stylesheets_without_5" has ckeditor_stylesheets configured, but no corresponding ckeditor5-stylesheets configuration. See https://www.drupal.org/node/3259165 for details.', 5000)); + + $warning = 'Your default theme test_ckeditor_stylesheets_without_5 has ckeditor_stylesheets configured, but no corresponding ckeditor5-stylesheets configuration. See https://www.drupal.org/node/3259165 for details'; + $this->assertFalse($assert_session->waitForText($warning, 5000)); $this->installThemeThatTriggersWarning(); $this->drupalGet('admin/config/content/formats/manage/ckeditor5'); - $this->assertTrue($assert_session->waitForText('Your default theme "test_ckeditor_stylesheets_without_5" has ckeditor_stylesheets configured, but no corresponding ckeditor5-stylesheets configuration. See https://www.drupal.org/node/3259165 for details.')); + $this->assertTrue($assert_session->waitForText($warning)); } }