[BUGFIX] Exceptions if EXT:context_help is not installed 29/20929/3
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 13:57:19 +0000 (15:57 +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/20929
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
Reviewed-by: Felix Kopp
Reviewed-by: Stefan Neufeind
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
typo3/sysext/core/Classes/Core/Bootstrap.php

index fec4c07..3e85c46 100644 (file)
@@ -303,7 +303,9 @@ class Bootstrap {
                        Utility\ExtensionManagementUtility::registerExtDirectComponent('TYPO3.Components.PageTree.ContextMenuDataProvider', 'TYPO3\\CMS\\Backend\\ContextMenu\\Pagetree\\Extdirect\\ContextMenuConfiguration', 'web', 'user,group');
                        Utility\ExtensionManagementUtility::registerExtDirectComponent('TYPO3.LiveSearchActions.ExtDirect', 'TYPO3\\CMS\\Backend\\Search\\LiveSearch\\ExtDirect\\LiveSearchDataProvider', 'web_list', 'user,group');
                        Utility\ExtensionManagementUtility::registerExtDirectComponent('TYPO3.BackendUserSettings.ExtDirect', 'TYPO3\\CMS\\Backend\\User\\ExtDirect\\BackendUserSettingsDataProvider');
-                       Utility\ExtensionManagementUtility::registerExtDirectComponent('TYPO3.CSH.ExtDirect', 'TYPO3\\CMS\\ContextHelp\\ExtDirect\\ContextHelpDataProvider');
+                       if (Utility\ExtensionManagementUtility::isLoaded('context_help')) {
+                               Utility\ExtensionManagementUtility::registerExtDirectComponent('TYPO3.CSH.ExtDirect', 'TYPO3\\CMS\\ContextHelp\\ExtDirect\\ContextHelpDataProvider');
+                       }
                        Utility\ExtensionManagementUtility::registerExtDirectComponent('TYPO3.ExtDirectStateProvider.ExtDirect', 'TYPO3\\CMS\\Backend\\InterfaceState\\ExtDirect\\DataProvider');
                        Utility\ExtensionManagementUtility::registerExtDirectComponent(
                                'TYPO3.Components.DragAndDrop.CommandController',