[BUGFIX] Exceptions if EXT:context_help is not installed 94/22294/2
authorDmitry Dulepov <dmitry.dulepov@gmail.com>
Mon, 20 May 2013 11:25:34 +0000 (15:25 +0400)
committerChristian Kuhn <lolli@schwarzbu.ch>
Sun, 14 Jul 2013 14:06:08 +0000 (16:06 +0200)
If the extension 'context_help' is not installed, the web
server's error log sometimes shows exceptions like "Class
'TYPO3\CMS\ContextHelp\ExtDirect\ContextHelpDataProvider'
not found" and "Invalid argument supplied for foreach()".
This happens because the class in question is registered
to ExtDirect without checking if the corresponding
extension is loaded.

Change-Id: Ic773cff2822912aac7841955be2f09d77169fdb9
Resolves: #48394
Releases: 6.0, 6.1, 6.2
Reviewed-on: https://review.typo3.org/22294
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
typo3/sysext/core/Classes/Core/Bootstrap.php

index 3ddb8da..2408e03 100644 (file)
@@ -252,7 +252,9 @@ class Bootstrap {
                        \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::registerExtDirectComponent('TYPO3.Components.PageTree.ContextMenuDataProvider', 'TYPO3\\CMS\\Backend\\ContextMenu\\Pagetree\\Extdirect\\ContextMenuConfiguration', 'web', 'user,group');
                        \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::registerExtDirectComponent('TYPO3.LiveSearchActions.ExtDirect', 'TYPO3\\CMS\\Backend\\Search\\LiveSearch\\ExtDirect\\LiveSearchDataProvider', 'web_list', 'user,group');
                        \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::registerExtDirectComponent('TYPO3.BackendUserSettings.ExtDirect', 'TYPO3\\CMS\\Backend\\User\\ExtDirect\\BackendUserSettingsDataProvider');
-                       \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::registerExtDirectComponent('TYPO3.CSH.ExtDirect', 'TYPO3\\CMS\\ContextHelp\\ExtDirect\\ContextHelpDataProvider');
+                       if (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('context_help')) {
+                               \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::registerExtDirectComponent('TYPO3.CSH.ExtDirect', 'TYPO3\\CMS\\ContextHelp\\ExtDirect\\ContextHelpDataProvider');
+                       }
                        \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::registerExtDirectComponent('TYPO3.ExtDirectStateProvider.ExtDirect', 'TYPO3\\CMS\\Backend\\InterfaceState\\ExtDirect\\DataProvider');
                        \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::registerExtDirectComponent('TYPO3.Components.DragAndDrop.CommandController',
                                \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('backend') . 'Classes/View/PageLayout/Extdirect/ExtdirectPageCommands.php:TYPO3\\CMS\\Backend\\View\\PageLayout\\ExtDirect\\ExtdirectPageCommands', 'web', 'user,group');