Closed ChrisSoelder closed 2 years ago
Hello,
unfortunately this issue is still not resolved. I have the same problem as @ChrisSoelder even with latest version 1.9.4
Ckeditor is checking base path as follows via following regex: var basePathSrcPattern = /(^|.*[\\\/])ckeditor\.js(?:\?.*|;.*)?$/i;
- see ckeditor_base.js
It means, that it expects ckeditor.js
file referenced in some <script>
tag. Everything works fine until you set $GLOBALS['TYPO3_CONF_VARS']['FE']['versionNumberInFilename'] = 'embed'
, then the ckeditor.js
file gets version number within the name, f.e.: ckeditor.1571124595.js
, which violates the regex and then CKEDITOR_BASEPATH
is not set properly and doesn't work for subpages.
As a workaround I have used $GLOBALS['TYPO3_CONF_VARS']['FE']['versionNumberInFilename'] = 'querystring'
, but I would suggest to add
<script>window.CKEDITOR_BASEPATH = $domainName</script>
by your extension. Domain name should be configurable or you should get it somehow automatically.
Same problem in TYPO3 v.10.4.9 $GLOBALS['TYPO3_CONF_VARS']['FE']['versionNumberInFilename'] = 'querystring' fixes a part of the problem.
The reason for wrong file paths seems to be in EXT:rte_ckeditor/ext_localconf.php line 12:
if (TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_BE) { \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( \TYPO3\CMS\Core\Page\PageRenderer::class )->addRequireJsConfiguration([ 'shim' => [ 'ckeditor' => ['exports' => 'CKEDITOR'] ], 'paths' => [ 'ckeditor' => \TYPO3\CMS\Core\Utility\PathUtility::getAbsoluteWebPath( \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('rte_ckeditor', 'Resources/Public/JavaScript/Contrib/') ) . 'ckeditor' ] ]); }
In my case, replacing line 12 as a test fixes the problem: if (TYPO3_REQUESTTYPE) {
In EXT:frontend_editing/Classes/Hook/FrontendEditingInitializationHook.php
on line 433 add: , 'ckeditor' => PathUtility::getAbsoluteWebPath( ExtensionManagementUtility::extPath('rte_ckeditor', 'Resources/Public/JavaScript/Contrib/') ) . 'ckeditor'
In Install Tool or LocalConfiguration.php or AdditionalConfiguration.php: $GLOBALS['TYPO3_CONF_VARS']['FE']['versionNumberInFilename'] = 'querystring'; $GLOBALS['TYPO3_CONF_VARS']['FE']['compressionLevel'] = 5; compressionLevel has to be > 0
Thank you for the feedback and fix, @birgitberlin! I'm reopening this issue now.
On my installation ckeditor fails to initialize in frontend because the path to its installation folder (CKEDITOR.basePath) isn't resolved correctly.
When loading the frontend with everything set up correctly i'm getting the following error
After some digging into the code I was able to find out that CKEDITOR.basePath doesn't resolve correctly to it's installation URL when ckeditor ist loaded. To solve this issue i tried setting the javascript variable window.CKEDITOR_BASEPATH = '/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/' before ckeditor is initialized. After that all js dependencies for ckeditor were correctly loaded an Inline editing worked as it should.
I've tested this behaviour with Typo3 9.5.10 on PHP 7.2 using the new Site Configuration Module for Site Setup.
My composer Setup looks like this