Hi there,
New to SilverStripe and new to the forums.
I just installed a fresh version of Silverstripe on top of Ubuntu/Nginx/PHP/Mysql and so far everything has worked perfectly except for the following:
When I go to load the page editor, the page fails to load the TinyMCE Editor and inspector shows the error:
Uncaught SyntaxError: Unexpected token <
Essentially....
At the bottom of the page in the Javascript Includes area, there is an include attempting to load a .php file instead of a .js file and of course fails when the first line is "<?php"
<script type="text/javascript" src="/framework/thirdparty/tinymce/tiny_mce_gzip.php?m=1384281859&js=1&plugins=table,emotions,paste,media,fullscreen,inlinepopups,advimagescale&themes=advanced&languages=en&diskcache=true&src=false"></script>
Is this a failure on something else, or is there somewhere I can change it to load the .js file instead of the .php file.
Thanks!
------------------
Found a solution:
Under /framework/forms/HtmlEditorField.php i replaced the following block of code:
if(Config::inst()->get('HtmlEditorField', 'use_gzip')) {
$internalPlugins = array();
foreach($configObj->getPlugins() as $plugin => $path) if(!$path) $internalPlugins[] = $plugin;
$tag = TinyMCE_Compressor::renderTag(array(
'url' => THIRDPARTY_DIR . '/tinymce/tiny_mce_gzip.js',
'plugins' => implode(',', $internalPlugins),
'themes' => 'advanced',
'languages' => $configObj->getOption('language')
), true);
preg_match('/src="([^"]*)"/', $tag, $matches);
Requirements::javascript(html_entity_decode($matches[1]));
} else {
Requirements::javascript(MCE_ROOT . 'tiny_mce_src.js');
}
with
Requirements::javascript(MCE_ROOT . 'tiny_mce_src.js');