[TASK] Clarify exception message for addPlugin() 62/31562/2
authorHelmut Hummel <helmut.hummel@typo3.org>
Thu, 10 Jul 2014 13:52:52 +0000 (15:52 +0200)
committerHelmut Hummel <helmut.hummel@typo3.org>
Thu, 10 Jul 2014 15:49:59 +0000 (17:49 +0200)
Add verbosity to the exception message to make it
more clear what is going wrong.

Releases: 6.2, 6.3
Resolves: #60225
Change-Id: I7bb4a16ff94d05b8b97633383d42c61aa600b1cf
Reviewed-on: https://review.typo3.org/31562
Reviewed-by: Helmut Hummel
Tested-by: Helmut Hummel
typo3/sysext/core/Classes/Utility/ExtensionManagementUtility.php

index ecbf8f5..ba6e0b5 100644 (file)
@@ -1247,7 +1247,14 @@ class ExtensionManagementUtility {
        static public function addPlugin($itemArray, $type = 'list_type', $extensionKey = NULL) {
                $extensionKey = $extensionKey ?: $GLOBALS['_EXTKEY'];
                if (!isset($extensionKey)) {
-                       throw new \RuntimeException('No extensionKey set in addPlugin(). Provide it as third Parameter', 1404068038);
+                       throw new \RuntimeException(
+                               'No extension key could be determined when calling addPlugin()!'
+                               . LF
+                               . 'This method is meant to be called from an ext_tables.php or Configuration/TCA/Overrides file. '
+                               . 'If you call it from Configuration/TCA/Overrides, the extension key needs to be specified as third parameter. '
+                               . 'Calling it from any other place e.g. ext_localconf.php does not work and is not supported.',
+                               1404068038
+                       );
                }
                if ($extensionKey && !$itemArray[2] && isset($GLOBALS['TYPO3_LOADED_EXT'][$extensionKey]['ext_icon'])) {
                        $itemArray[2] = self::extRelPath($extensionKey) . $GLOBALS['TYPO3_LOADED_EXT'][$extensionKey]['ext_icon'];