From f51ce1a430522fcbc1760d60b2dabf646fa7ffb0 Mon Sep 17 00:00:00 2001 From: Christer Vindberg Date: Wed, 8 Mar 2017 13:14:29 +0100 Subject: [PATCH 1/1] [BUGFIX] Skip CKEditor registration on CLI MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Made sure the CKEditor RequireJS paths are not calculated when running in a CLI context. When rte_ckeditor is installed, all caches are cleared and the first hit to a TYPO3 installation is a CLI command, the backend RequireJS paths are calculated and saved wrongly causing the backend to fail afterwards. How to replicate: * install rte_ckeditor * delete var/Cache/ * run typo3/cli_dispatch.phpsh * visit backend Resolves: #80183 Releases: master Change-Id: I5de9462a6f577f2eb6c06adabe44a6a86e3c2592 Reviewed-on: https://review.typo3.org/51981 Reviewed-by: Mathias Brodala Tested-by: Mathias Brodala Reviewed-by: Anders Kostending Tested-by: TYPO3com Reviewed-by: Frank Nägler Tested-by: Frank Nägler --- typo3/sysext/rte_ckeditor/ext_localconf.php | 26 +++++++++++---------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/typo3/sysext/rte_ckeditor/ext_localconf.php b/typo3/sysext/rte_ckeditor/ext_localconf.php index 73bc777b0061..b7e1151ee6e6 100644 --- a/typo3/sysext/rte_ckeditor/ext_localconf.php +++ b/typo3/sysext/rte_ckeditor/ext_localconf.php @@ -8,18 +8,20 @@ $GLOBALS['TYPO3_CONF_VARS']['SYS']['formEngine']['nodeResolver'][1480314091] = [ 'class' => \TYPO3\CMS\RteCKEditor\Form\Resolver\RichTextNodeResolver::class, ]; -\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' - ] -]); +if ((TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_CLI) === 0) { + \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' + ] + ]); +} // Register the presets $GLOBALS['TYPO3_CONF_VARS']['RTE']['Presets']['default'] = 'EXT:rte_ckeditor/Configuration/RTE/Default.yaml'; -- 2.20.1