From 39aa62009da46e3464e833707f9819dea218f733 Mon Sep 17 00:00:00 2001 From: bnjmnm <benm@umich.edu> 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 5be20aab8a7b..c292f015129b 100644 --- a/core/modules/ckeditor5/ckeditor5.module +++ b/core/modules/ckeditor5/ckeditor5.module @@ -638,7 +638,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 00e06f7788ef..3ae291c2c2d5 100644 --- a/core/modules/ckeditor5/tests/src/Functional/AddedStylesheetsTest.php +++ b/core/modules/ckeditor5/tests/src/Functional/AddedStylesheetsTest.php @@ -84,6 +84,7 @@ function (ConstraintViolation $v) { 'use text format llama', 'administer themes', 'view the administration theme', + 'administer filters', ]); $this->drupalLogin($this->adminUser); } @@ -103,6 +104,11 @@ public function testCkeditorStylesheets() { $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 53e70a9466f3..a640fa7f8c9f 100644 --- a/core/themes/claro/claro.info.yml +++ b/core/themes/claro/claro.info.yml @@ -166,6 +166,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 0eb7d15af8ee..7f8d37b66db2 100644 --- a/core/themes/olivero/olivero.info.yml +++ b/core/themes/olivero/olivero.info.yml @@ -88,3 +88,5 @@ ckeditor_stylesheets: - css/components/table.css - css/components/text-content.css - css/theme/ckeditor-frame.css + +ckeditor5-stylesheets: false -- GitLab