From a385888db28139736eccf54f2377bb6d883485d9 Mon Sep 17 00:00:00 2001 From: bnjmnm Date: Wed, 31 Aug 2022 11:22:32 -0400 Subject: [PATCH] Issue #3285054 by lauriii, Wim Leers: Add ckeditor5-stylesheets: false to Claro and Olivero (and fix it) --- core/modules/ckeditor5/ckeditor5.module | 2 +- .../ckeditor5/tests/src/Functional/AddedStylesheetsTest.php | 6 ++++++ core/themes/claro/claro.info.yml | 2 ++ core/themes/olivero/olivero.info.yml | 2 ++ 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/core/modules/ckeditor5/ckeditor5.module b/core/modules/ckeditor5/ckeditor5.module index 77922103458..05933fd4a45 100644 --- a/core/modules/ckeditor5/ckeditor5.module +++ b/core/modules/ckeditor5/ckeditor5.module @@ -639,7 +639,7 @@ function _ckeditor5_theme_css($theme = NULL): array { } if (isset($theme) && $theme_path = \Drupal::service('extension.list.theme')->getPath($theme)) { $info = \Drupal::service('extension.list.theme')->getExtensionInfo($theme); - if (isset($info['ckeditor5-stylesheets'])) { + if (isset($info['ckeditor5-stylesheets']) && $info['ckeditor5-stylesheets'] !== FALSE) { $css = $info['ckeditor5-stylesheets']; foreach ($css as $key => $url) { // CSS url is external or relative to Drupal root. diff --git a/core/modules/ckeditor5/tests/src/Functional/AddedStylesheetsTest.php b/core/modules/ckeditor5/tests/src/Functional/AddedStylesheetsTest.php index b87e1689d0e..7e8015ba73d 100644 --- a/core/modules/ckeditor5/tests/src/Functional/AddedStylesheetsTest.php +++ b/core/modules/ckeditor5/tests/src/Functional/AddedStylesheetsTest.php @@ -83,6 +83,7 @@ class AddedStylesheetsTest extends BrowserTestBase { 'use text format llama', 'administer themes', 'view the administration theme', + 'administer filters', ]); $this->drupalLogin($this->adminUser); } @@ -102,6 +103,11 @@ class AddedStylesheetsTest extends BrowserTestBase { $this->drupalGet('node/add/article'); $assert_session->responseNotContains('test_ckeditor_stylesheets_relative/css/yokotsoko.css'); + // Confirm that the missing ckeditor5-stylesheets configuration can be + // bypassed. + $this->drupalGet('admin/config/content/formats/manage/llama'); + $assert_session->pageTextNotContains('ckeditor_stylesheets configured without a corresponding ckeditor5-stylesheets configuration.'); + // Install a theme with ckeditor5-stylesheets configured. Do this manually // to confirm `library_info` cache tags are invalidated. $this->drupalGet('admin/appearance'); diff --git a/core/themes/claro/claro.info.yml b/core/themes/claro/claro.info.yml index bdf31c0e7c3..6032f10bc5d 100644 --- a/core/themes/claro/claro.info.yml +++ b/core/themes/claro/claro.info.yml @@ -173,6 +173,8 @@ ckeditor_stylesheets: - css/theme/ckeditor-frame.css - css/classy/components/media-embed-error.css +ckeditor5-stylesheets: false + regions: header: 'Header' pre_content: 'Pre-content' diff --git a/core/themes/olivero/olivero.info.yml b/core/themes/olivero/olivero.info.yml index 0143841641b..19a45e81920 100644 --- a/core/themes/olivero/olivero.info.yml +++ b/core/themes/olivero/olivero.info.yml @@ -90,3 +90,5 @@ ckeditor_stylesheets: - css/components/table.css - css/components/text-content.css - css/theme/ckeditor-frame.css + +ckeditor5-stylesheets: false