[TASK] Deprecate configureModule in extbase ExtensionUtility 17/39317/2
authorBenjamin Mack <benni@typo3.org>
Thu, 7 May 2015 05:18:25 +0000 (13:18 +0800)
committerWouter Wolters <typo3@wouterwolters.nl>
Thu, 7 May 2015 06:46:52 +0000 (08:46 +0200)
There is a duplicate function placed in EXT:extbase/ExtensionUtility
and in ExtensionManagementUtility in the core.

The extbase-reference can be deprecated and the core class can
be used instead.

Resolves: #66823
Releases: master
Change-Id: If02facd20d6276fe22feb7dc945902fe1ef34747
Reviewed-on: http://review.typo3.org/39317
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Tested-by: Andreas Fernandez <typo3@scripting-base.de>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
typo3/sysext/core/Classes/Utility/ExtensionManagementUtility.php
typo3/sysext/core/Documentation/Changelog/master/Deprecation-66823-ExtensionUtilityConfigureModule.rst [new file with mode: 0644]
typo3/sysext/extbase/Classes/Utility/ExtensionUtility.php

index 1a18b18..ba21643 100644 (file)
@@ -788,10 +788,6 @@ class ExtensionManagementUtility {
         * This method is called from \TYPO3\CMS\Backend\Module\ModuleLoader::checkMod
         * and it replaces old conf.php.
         *
-        * The original function for is called
-        * typo3/sysext/extbase/Classes/Utility/ExtensionUtility.php::configureModule
-        * the referred function can be deprecated now
-        *
         * @param string $moduleSignature The module name
         * @param string $modulePath Absolute path to module (not used by Extbase currently)
         * @return array Configuration of the module
diff --git a/typo3/sysext/core/Documentation/Changelog/master/Deprecation-66823-ExtensionUtilityConfigureModule.rst b/typo3/sysext/core/Documentation/Changelog/master/Deprecation-66823-ExtensionUtilityConfigureModule.rst
new file mode 100644 (file)
index 0000000..4e99659
--- /dev/null
@@ -0,0 +1,28 @@
+================================================================================
+Deprecation: #66823 - Deprecate Extbase ExtensionUtility->configureModule method
+================================================================================
+
+Description
+===========
+
+The method ``TYPO3\CMS\Extbase\Utility\ExtensionUtility->configureModule()`` has been marked for deprecation, and will
+be removed with TYPO3 CMS 8.
+
+
+Impact
+======
+
+Calling ``TYPO3\CMS\Extbase\Utility\ExtensionUtility->configureModule()`` will throw a deprecation message.
+
+
+Affected Installations
+======================
+
+Any installation with a third-party extension making use of ``ExtensionUtility->configureModule()`` directly
+inside e.g. ext_tables.php.
+
+
+Migration
+=========
+
+Use the 1:1 functionality in ``TYPO3\CMS\Core\Utility\ExtensionManagementUtility->configureModule()`` directly.
index 214a9ac..b22a7bb 100644 (file)
@@ -149,29 +149,11 @@ tt_content.' . $pluginSignature . ' {
         * @param string $moduleSignature The module name
         * @param string $modulePath Absolute path to module (not used by Extbase currently)
         * @return array Configuration of the module
+        * @deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 8, please use the according method in \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::configureModule
         */
        static public function configureModule($moduleSignature, $modulePath) {
-               $moduleConfiguration = $GLOBALS['TBE_MODULES']['_configuration'][$moduleSignature];
-               $iconPathAndFilename = $moduleConfiguration['icon'];
-               if (substr($iconPathAndFilename, 0, 4) === 'EXT:') {
-                       list($extensionKey, $relativePath) = explode('/', substr($iconPathAndFilename, 4), 2);
-                       $iconPathAndFilename = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($extensionKey) . $relativePath;
-               }
-               // @todo skin support
-               $moduleLabels = array(
-                       'tabs_images' => array(
-                               'tab' => $iconPathAndFilename
-                       ),
-                       'labels' => array(
-                               'tablabel' => $GLOBALS['LANG']->sL($moduleConfiguration['labels'] . ':mlang_labels_tablabel'),
-                               'tabdescr' => $GLOBALS['LANG']->sL($moduleConfiguration['labels'] . ':mlang_labels_tabdescr')
-                       ),
-                       'tabs' => array(
-                               'tab' => $GLOBALS['LANG']->sL($moduleConfiguration['labels'] . ':mlang_tabs_tab')
-                       )
-               );
-               $GLOBALS['LANG']->addModuleLabels($moduleLabels, $moduleSignature . '_');
-               return $moduleConfiguration;
+               \TYPO3\CMS\Core\Utility\GeneralUtility::logDeprecatedFunction();
+               return \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::configureModule($moduleSignature, $modulePath);
        }
 
        /**
@@ -226,7 +208,7 @@ tt_content.' . $pluginSignature . ' {
                        $moduleConfiguration['vendorName'] = $vendorName;
                }
                $moduleConfiguration['extensionName'] = $extensionName;
-               $moduleConfiguration['configureModuleFunction'] = array(\TYPO3\CMS\Extbase\Utility\ExtensionUtility::class, 'configureModule');
+               $moduleConfiguration['configureModuleFunction'] = array(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::class, 'configureModule');
                $GLOBALS['TBE_MODULES']['_configuration'][$moduleSignature] = $moduleConfiguration;
                if (!is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['extbase']['extensions'][$extensionName]['modules'][$moduleSignature])) {
                        $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['extbase']['extensions'][$extensionName]['modules'][$moduleSignature] = array();