Loading core/modules/ckeditor/ckeditor.module +6 −0 Changes for core/modules/ckeditor/ckeditor.module: 6 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -89,9 +89,15 @@ function _ckeditor_theme_css($theme = NULL) { if (isset($info['ckeditor_stylesheets'])) { $css = $info['ckeditor_stylesheets']; foreach ($css as $key => $url) { // CSS url is external. if (UrlHelper::isExternal($url)) { $css[$key] = $url; } // CSS url is relative to Drupal root. elseif ($url[0] === '/') { $css[$key] = substr($url, 1); } // CSS url is relative to theme. else { $css[$key] = $theme_path . '/' . $url; } Loading core/modules/ckeditor/tests/src/Functional/CKEditorLoadingTest.php +8 −0 Changes for core/modules/ckeditor/tests/src/Functional/CKEditorLoadingTest.php: 8 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -242,6 +242,14 @@ public function testExternalStylesheets() { 'core/modules/system/tests/themes/test_ckeditor_stylesheets_relative/css/yokotsoko.css', ]; $this->assertIdentical($expected, _ckeditor_theme_css('test_ckeditor_stylesheets_relative')); // Case 4: Install theme which has a Drupal root CSS URL. $theme_installer->install(['test_ckeditor_stylesheets_drupal_root']); $this->config('system.theme')->set('default', 'test_ckeditor_stylesheets_drupal_root')->save(); $expected = [ 'core/modules/system/tests/themes/test_ckeditor_stylesheets_drupal_root/css/yokotsoko.css', ]; $this->assertIdentical($expected, _ckeditor_theme_css('test_ckeditor_stylesheets_drupal_root')); } protected function getThingsToCheck() { Loading core/modules/system/tests/themes/test_ckeditor_stylesheets_drupal_root/css/yokotsoko.css 0 → 100644 +4 −0 Changes for core/modules/system/tests/themes/test_ckeditor_stylesheets_drupal_root/css/yokotsoko.css: 4 added lines, 0 removed lines. Original line number Diff line number Diff line /** * @file * Test CSS asset file for test_ckeditor_stylesheets_drupal_root.theme. */ core/modules/system/tests/themes/test_ckeditor_stylesheets_drupal_root/test_ckeditor_stylesheets_drupal_root.info.yml 0 → 100644 +9 −0 Changes for core/modules/system/tests/themes/test_ckeditor_stylesheets_drupal_root/test_ckeditor_stylesheets_drupal_root.info.yml: 9 added lines, 0 removed lines. Original line number Diff line number Diff line name: Test Drupal root CKEditor stylesheets type: theme description: 'A theme that uses a Drupal root CKEditor stylesheet.' package: Testing version: VERSION base theme: false ckeditor_stylesheets: - /core/modules/system/tests/themes/test_ckeditor_stylesheets_drupal_root/css/yokotsoko.css Loading
core/modules/ckeditor/ckeditor.module +6 −0 Changes for core/modules/ckeditor/ckeditor.module: 6 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -89,9 +89,15 @@ function _ckeditor_theme_css($theme = NULL) { if (isset($info['ckeditor_stylesheets'])) { $css = $info['ckeditor_stylesheets']; foreach ($css as $key => $url) { // CSS url is external. if (UrlHelper::isExternal($url)) { $css[$key] = $url; } // CSS url is relative to Drupal root. elseif ($url[0] === '/') { $css[$key] = substr($url, 1); } // CSS url is relative to theme. else { $css[$key] = $theme_path . '/' . $url; } Loading
core/modules/ckeditor/tests/src/Functional/CKEditorLoadingTest.php +8 −0 Changes for core/modules/ckeditor/tests/src/Functional/CKEditorLoadingTest.php: 8 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -242,6 +242,14 @@ public function testExternalStylesheets() { 'core/modules/system/tests/themes/test_ckeditor_stylesheets_relative/css/yokotsoko.css', ]; $this->assertIdentical($expected, _ckeditor_theme_css('test_ckeditor_stylesheets_relative')); // Case 4: Install theme which has a Drupal root CSS URL. $theme_installer->install(['test_ckeditor_stylesheets_drupal_root']); $this->config('system.theme')->set('default', 'test_ckeditor_stylesheets_drupal_root')->save(); $expected = [ 'core/modules/system/tests/themes/test_ckeditor_stylesheets_drupal_root/css/yokotsoko.css', ]; $this->assertIdentical($expected, _ckeditor_theme_css('test_ckeditor_stylesheets_drupal_root')); } protected function getThingsToCheck() { Loading
core/modules/system/tests/themes/test_ckeditor_stylesheets_drupal_root/css/yokotsoko.css 0 → 100644 +4 −0 Changes for core/modules/system/tests/themes/test_ckeditor_stylesheets_drupal_root/css/yokotsoko.css: 4 added lines, 0 removed lines. Original line number Diff line number Diff line /** * @file * Test CSS asset file for test_ckeditor_stylesheets_drupal_root.theme. */
core/modules/system/tests/themes/test_ckeditor_stylesheets_drupal_root/test_ckeditor_stylesheets_drupal_root.info.yml 0 → 100644 +9 −0 Changes for core/modules/system/tests/themes/test_ckeditor_stylesheets_drupal_root/test_ckeditor_stylesheets_drupal_root.info.yml: 9 added lines, 0 removed lines. Original line number Diff line number Diff line name: Test Drupal root CKEditor stylesheets type: theme description: 'A theme that uses a Drupal root CKEditor stylesheet.' package: Testing version: VERSION base theme: false ckeditor_stylesheets: - /core/modules/system/tests/themes/test_ckeditor_stylesheets_drupal_root/css/yokotsoko.css