Merge pull request #7760 from open-sausages/pulls/4/fix-editor-public-resolve

BUG Fix themed editor.css url not being resolved properly
This commit is contained in:
Robbie Averill 2018-01-17 12:08:32 +13:00 committed by GitHub
commit 40b2aeb7a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -631,11 +631,10 @@ class TinyMCEConfig extends HTMLEditorConfig
// Add standard editor.css
$editorCSSFiles = $this->config()->get('editor_css');
$resourceLoader = ModuleResourceLoader::singleton();
if ($editorCSSFiles) {
foreach ($editorCSSFiles as $editorCSS) {
$path = ModuleResourceLoader::singleton()
->resolveURL($editorCSS);
$editor[] = Director::absoluteURL($path);
$editor[] = $resourceLoader->resolveURL($editorCSS);
}
}
@ -643,7 +642,7 @@ class TinyMCEConfig extends HTMLEditorConfig
$themes = HTMLEditorConfig::getThemes() ?: SSViewer::get_themes();
$themedEditor = ThemeResourceLoader::inst()->findThemedCSS('editor', $themes);
if ($themedEditor) {
$editor[] = Director::absoluteURL($themedEditor);
$editor[] = $resourceLoader->resolveURL($themedEditor);
}
return $editor;