When you set the Editor CSS to 'Use theme CSS', and your site theme is a sub-theme, the base theme CSS is not loaded. Only the CSS for the sub theme is loaded for the theme. Anyone else seeing this? The base themes CSS should be loaded, in my case that is where most of the styles come from.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

m4olivei’s picture

Update: this behavior only occurs when you are using an admin theme for content editing. If you turn off the admin theme, it works as desired.

m4olivei’s picture

Annnnd a patch is attached. Please try, patch is against 7.x-1.x branch.

The issue seems to be that ckeditor module uses variable_get('theme_default', $theme) to decide what the current theme is, which is good, that means the css from the current theme gets grabbed, however the global $base_theme_info variable is set according to what the active theme is, which when you have an admin theme set, as in my case, is seven. So because seven has no base theme, no furthur CSS is included. The patch goes through the array returned by list_themes() to acertain the CSS needed from the base themes.

m4olivei’s picture

Version: 7.x-1.4 » 7.x-1.x-dev
Status: Active » Needs review
fearlsgroove’s picture

Attached is a similar effort (found this after the fact somehow). This uses the values already available from the $theme_info->base_themes array and the list_themes() result. More lines due to indentations and some stylistic changes that you may not prefer ...

aleksijohansson’s picture

Issue summary: View changes
Status: Needs review » Reviewed & tested by the community

#4 seems to be still a valid patch for the current 7.x-1.x-dev version and works for me!

The last submitted patch, 2: admin_theme_subsite_use_theme_css-1330794-2.patch, failed testing.

slatty’s picture

This method includes recursion to also search for sub-themes within sub-themes

lisa.ugray’s picture

I've tested #7 and can verify that it works as intended.

bwaindwain’s picture

#7 works for me. Thanks!

bwaindwain’s picture

With patch #7, I was seeing this message in the browser console "Resource interpreted as Stylesheet but transferred with MIME type text/html: "http://localhost/w288/node/1/sites/all/modules/contrib/ckeditor/css/cked...".

The path to ckeditor.css was missing the initial "/" and, in our case, subfolder. Here's a patch.

Mile23’s picture

The patch in #7 is listed as a recommended patch against CKEditor for installing with Media: https://www.drupal.org/node/2843391

  • jcisio committed aa44260 on 7.x-1.x authored by bwaindwain
    Issue #1330794 by m4olivei, bwaindwain, ConfuciusDa1st, fearlsgroove:...
jcisio’s picture

Status: Reviewed & tested by the community » Fixed

I moved patch #10 around for more logical order and committed. Thanks.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

dalemoore’s picture

From what I can tell this doesn't include CSS added via drupal_add_css in template.php, only CSS added in the info file. Am I mistaken? Or maybe I've somehow introduced a bug in my own setup. If I comment out my added CSS in template.php and move it into the info file, my styles load in CKEditor, but they don't otherwise.