[TASK] Move Backend Module calls to index.php 05/41305/7
authorWouter Wolters <typo3@wouterwolters.nl>
Wed, 15 Jul 2015 14:46:19 +0000 (16:46 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Wed, 15 Jul 2015 20:39:21 +0000 (22:39 +0200)
The typo3/mod.php entrypoint is removed in favor of
checking for M in all backend requests inside the Backend
Application.

The request object from the server is now enhanced with the
information inside the application which type is now called.

Resolves: #68183
Releases: master
Change-Id: Ia51244bb1a017ac5736c1133d14066b76b3d1f72
Reviewed-on: http://review.typo3.org/41305
Reviewed-by: Benjamin Mack <benni@typo3.org>
Tested-by: Benjamin Mack <benni@typo3.org>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
40 files changed:
typo3/mod.php
typo3/sysext/backend/Classes/Backend/ToolbarItems/ShortcutToolbarItem.php
typo3/sysext/backend/Classes/Http/Application.php
typo3/sysext/backend/Classes/Http/BackendModuleRequestHandler.php
typo3/sysext/backend/Classes/Http/RequestHandler.php
typo3/sysext/backend/Classes/Module/ModuleLoader.php
typo3/sysext/backend/Classes/Template/DocumentTemplate.php
typo3/sysext/backend/Classes/Utility/BackendUtility.php
typo3/sysext/backend/Modules/Browser/conf.php
typo3/sysext/backend/Modules/Dummy/conf.php
typo3/sysext/backend/Modules/File/Administration/conf.php
typo3/sysext/backend/Modules/File/Database/conf.php
typo3/sysext/backend/Modules/File/Edit/conf.php
typo3/sysext/backend/Modules/File/Newfolder/conf.php
typo3/sysext/backend/Modules/FormEngine/conf.php
typo3/sysext/backend/Modules/RecordHistory/conf.php
typo3/sysext/backend/Modules/ShowItem/conf.php
typo3/sysext/backend/Modules/Wizards/AddWizard/conf.php
typo3/sysext/backend/Modules/Wizards/BackendLayoutWizard/conf.php
typo3/sysext/backend/Modules/Wizards/ColorpickerWizard/conf.php
typo3/sysext/backend/Modules/Wizards/EditWizard/conf.php
typo3/sysext/backend/Modules/Wizards/ListWizard/conf.php
typo3/sysext/backend/Modules/Wizards/RteWizard/conf.php
typo3/sysext/backend/Modules/Wizards/TableWizard/conf.php
typo3/sysext/compatibility6/Modules/Wizards/FormsWizard/conf.php
typo3/sysext/core/Classes/Core/SystemEnvironmentBuilder.php
typo3/sysext/core/Classes/Utility/ExtensionManagementUtility.php
typo3/sysext/core/Documentation/Changelog/master/Deprecation-68141-Typo3ajaxphp.rst
typo3/sysext/core/Documentation/Changelog/master/Deprecation-68183-Typo3modphp.rst [new file with mode: 0644]
typo3/sysext/core/Tests/Unit/Utility/GeneralUtilityTest.php
typo3/sysext/extbase/Classes/Core/ModuleRunner.php
typo3/sysext/extbase/Classes/Mvc/Web/Routing/UriBuilder.php
typo3/sysext/extbase/Tests/Unit/Mvc/Web/Routing/UriBuilderTest.php
typo3/sysext/form/Modules/Wizards/FormWizard/conf.php
typo3/sysext/install/Classes/Service/SilentConfigurationUpgradeService.php
typo3/sysext/install/Classes/Updates/MigrateShortcutUrlsAgainUpdate.php [new file with mode: 0644]
typo3/sysext/install/Classes/Updates/MigrateShortcutUrlsUpdate.php [deleted file]
typo3/sysext/install/ext_localconf.php
typo3/sysext/openid/wizard/conf.php
typo3/sysext/recordlist/Modules/Wizards/ElementBrowserWizard/conf.php

index 03ca81e..b0294d1 100644 (file)
@@ -21,5 +21,9 @@ namespace TYPO3\CMS\Backend;
  */
 call_user_func(function() {
        $classLoader = require __DIR__ . '/vendor/autoload.php';
-       (new \TYPO3\CMS\Backend\Http\Application($classLoader))->run();
+       (new \TYPO3\CMS\Backend\Http\Application($classLoader))->run(function() {
+               \TYPO3\CMS\Core\Utility\GeneralUtility::deprecationLog(
+                       'The entry point to mod.php was moved to index.php with "M" given. Please use BackendUtility::getModuleUrl(\'myModuleKey\') to link to a module. This script will be removed in TYPO3 CMS 8.'
+               );
+       });
 });
index 0a7975e..d747677 100644 (file)
@@ -300,7 +300,7 @@ class ShortcutToolbarItem implements ToolbarItemInterface {
        }
 
        /**
-        * Adds the correct token, if the url is a mod.php script
+        * Adds the correct token, if the url is a index.php script
         *
         * @param string $url
         * @return string
@@ -313,7 +313,7 @@ class ShortcutToolbarItem implements ToolbarItemInterface {
                if (isset($parameters['returnUrl'])) {
                        $parsedReturnUrl = parse_url($parameters['returnUrl']);
                        parse_str($parsedReturnUrl['query'], $returnUrlParameters);
-                       if (strpos($parsedReturnUrl['path'], 'mod.php') !== FALSE && isset($returnUrlParameters['M'])) {
+                       if (strpos($parsedReturnUrl['path'], 'index.php') !== FALSE && isset($returnUrlParameters['M'])) {
                                $module = $returnUrlParameters['M'];
                                $returnUrl = BackendUtility::getModuleUrl($module, $returnUrlParameters);
                                $parameters['returnUrl'] = $returnUrl;
@@ -321,7 +321,7 @@ class ShortcutToolbarItem implements ToolbarItemInterface {
                        }
                }
 
-               if (strpos($parsedUrl['path'], 'mod.php') !== FALSE && isset($parameters['M'])) {
+               if (strpos($parsedUrl['path'], 'index.php') !== FALSE && isset($parameters['M'])) {
                        $module = $parameters['M'];
                        $url = BackendUtility::getModuleUrl($module, $parameters);
                }
index 1b9a976..28a4ada 100644 (file)
@@ -75,6 +75,8 @@ class Application implements ApplicationInterface {
                // see below when this option is set
                if ($GLOBALS['TYPO3_AJAX']) {
                        $this->request = $this->request->withAttribute('isAjaxRequest', TRUE);
+               } elseif (isset($this->request->getQueryParams()['M'])) {
+                       $this->request = $this->request->withAttribute('isModuleRequest', TRUE);
                }
 
                $this->bootstrap->configure();
@@ -115,7 +117,7 @@ class Application implements ApplicationInterface {
                // activate "AJAX" handler when called with the GET variable ajaxID
                if (GeneralUtility::_GET('ajaxID') !== NULL) {
                        $GLOBALS['TYPO3_AJAX'] = TRUE;
-               } elseif (substr($currentScript, -16) === '/typo3/index.php') {
+               } elseif (GeneralUtility::_GET('ajaxID') === NULL && substr($currentScript, -16) === '/typo3/index.php') {
                        // allow backend login to work
                        define('TYPO3_PROCEED_IF_NO_USER', 1);
                }
index 0a19c3f..dc062c5 100644 (file)
@@ -75,7 +75,7 @@ class BackendModuleRequestHandler implements RequestHandlerInterface {
                        throw new Exception('The CSRF protection token for the requested module is missing or invalid', 1417988921);
                }
 
-               // Set to empty as it is not needed / always coming from typo3/mod.php
+               // Set to empty as it is not needed / always coming from typo3/index.php
                $GLOBALS['BACK_PATH'] = '';
 
                $this->backendUserAuthentication = $GLOBALS['BE_USER'];
@@ -117,13 +117,13 @@ class BackendModuleRequestHandler implements RequestHandlerInterface {
        }
 
        /**
-        * This request handler can handle any backend request coming from mod.php
+        * This request handler can handle any backend request coming from index.php
         *
         * @param ServerRequestInterface $request
         * @return bool
         */
        public function canHandleRequest(ServerRequestInterface $request) {
-               return (TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_BE) && !empty((string)$request->getQueryParams()['M']);
+               return $request->getAttribute('isModuleRequest', FALSE);
        }
 
        /**
index 066b97b..afb6cfd 100644 (file)
@@ -21,7 +21,7 @@ use TYPO3\CMS\Core\Utility\GeneralUtility;
 /**
  * General RequestHandler for the TYPO3 Backend. This is used for all Backend requests except for CLI
  * or AJAX calls. Unlike all other RequestHandlers in the TYPO3 CMS Core, the actual logic for choosing
- * the controller is still done inside places like mod.php and each single file.
+ * the controller is still done inside places like each single file.
  * This RequestHandler here serves solely to check and set up all requirements needed for a TYPO3 Backend.
  * This class might be changed in the future.
  */
index 38de5c1..1fd54d0 100644 (file)
@@ -111,9 +111,9 @@ class ModuleLoader {
                 */
                $this->absPathArray = $modulesArray['_PATHS'];
                unset($modulesArray['_PATHS']);
-               // Unset the array for calling external backend module dispatchers in typo3/mod.php
+               // Unset the array for calling external backend module dispatchers in typo3/index.php
                unset($modulesArray['_dispatcher']);
-               // Unset the array for calling backend modules based on external backend module dispatchers in typo3/mod.php
+               // Unset the array for calling backend modules based on external backend module dispatchers in typo3/index.php
                unset($modulesArray['_configuration']);
                $this->navigationComponents = $modulesArray['_navigationComponents'];
                unset($modulesArray['_navigationComponents']);
index 1882b5c..6d621bb 100644 (file)
@@ -637,8 +637,8 @@ function jumpToUrl(URL) {
        public function makeShortcutIcon($gvList, $setList, $modName, $motherModName = '') {
                $storeUrl = $this->makeShortcutUrl($gvList, $setList);
                $pathInfo = parse_url(GeneralUtility::getIndpEnv('REQUEST_URI'));
-               // Add the module identifier automatically if typo3/mod.php is used:
-               if (preg_match('/typo3\\/mod\\.php$/', $pathInfo['path']) && isset($GLOBALS['TBE_MODULES']['_PATHS'][$modName])) {
+               // Add the module identifier automatically if typo3/index.php is used:
+               if (GeneralUtility::_GET('M') !== NULL && isset($GLOBALS['TBE_MODULES']['_PATHS'][$modName])) {
                        $storeUrl = '&M=' . $modName . $storeUrl;
                }
                if ((int)$motherModName === 1) {
index 37dc4c2..d319811 100644 (file)
@@ -3076,7 +3076,7 @@ class BackendUtility {
                if (!$script) {
                        $script = basename(PATH_thisScript);
                }
-               if ($script === 'mod.php' && GeneralUtility::_GET('M')) {
+               if ($script === 'index.php' && GeneralUtility::_GET('M')) {
                        $scriptUrl = self::getModuleUrl(GeneralUtility::_GET('M'), $mainParams) . $addParams;
                } else {
                        $scriptUrl = $script . '?' . GeneralUtility::implodeArrayForUrl('', $mainParams) . $addParams;
@@ -3269,7 +3269,7 @@ class BackendUtility {
                        'M' => $moduleName,
                        'moduleToken' => FormProtectionFactory::get()->generateToken('moduleCall', $moduleName)
                ) + $urlParameters;
-               $url = 'mod.php?' . ltrim(GeneralUtility::implodeArrayForUrl('', $urlParameters, '', TRUE, TRUE), '&');
+               $url = 'index.php?' . ltrim(GeneralUtility::implodeArrayForUrl('', $urlParameters, '', TRUE, TRUE), '&');
                if ($returnAbsoluteUrl) {
                        return GeneralUtility::getIndpEnv('TYPO3_REQUEST_DIR') . $url;
                } else {
index 60d7df1..fd9f925 100644 (file)
@@ -1,4 +1,3 @@
 <?php
-// Required for mod.php
 $MCONF['name'] = 'browser';
 $MCONF['script'] = '_DISPATCH';
\ No newline at end of file
index 31bd84d..92a6538 100644 (file)
@@ -1,4 +1,3 @@
 <?php
-// Required for mod.php
 $MCONF['name'] = 'dummy';
 $MCONF['script'] = '_DISPATCH';
\ No newline at end of file
index 782e289..f204a83 100644 (file)
@@ -1,4 +1,3 @@
 <?php
-// Required for mod.php
 $MCONF['name'] = 'tce_file';
 $MCONF['script'] = '_DISPATCH';
\ No newline at end of file
index 274737c..111f428 100644 (file)
@@ -1,4 +1,3 @@
 <?php
-// Required for mod.php
 $MCONF['name'] = 'tce_db';
 $MCONF['script'] = '_DISPATCH';
\ No newline at end of file
index 58ebf10..ecf1390 100644 (file)
@@ -1,5 +1,4 @@
 <?php
-//required for mod.php
 $MCONF['name'] = 'file_edit';
 $MCONF['script'] = '_DISPATCH';
 $MCONF['access'] = '';
\ No newline at end of file
index c235ed0..1ce8517 100644 (file)
@@ -1,5 +1,4 @@
 <?php
-//required for mod.php
 $MCONF['name'] = 'file_newfolder';
 $MCONF['script'] = '_DISPATCH';
 $MCONF['access'] = '';
\ No newline at end of file
index 11d101d..94b76c9 100644 (file)
@@ -1,4 +1,3 @@
 <?php
-// Required for mod.php
 $MCONF['name'] = 'record_edit';
-$MCONF['script'] = '_DISPATCH';
+$MCONF['script'] = '_DISPATCH';
\ No newline at end of file
index 9c3b329..30d3083 100644 (file)
@@ -1,5 +1,4 @@
 <?php
-//required for mod.php
 $MCONF['name'] = 'record_history';
 $MCONF['script'] = '_DISPATCH';
-$MCONF['access'] = '';
+$MCONF['access'] = '';
\ No newline at end of file
index 1ab6802..097fc1d 100644 (file)
@@ -1,4 +1,3 @@
 <?php
-// required for mod.php
 $MCONF['name'] = 'show_item';
 $MCONF['script'] = '_DISPATCH';
\ No newline at end of file
index 0b8828c..115c3f5 100644 (file)
@@ -1,5 +1,3 @@
 <?php
-//required for mod.php
 $MCONF['name'] = 'wizard_add';
-$MCONF['script'] = '_DISPATCH';
-$MCONF['access'] = '';
+$MCONF['script'] = '_DISPATCH';
\ No newline at end of file
index 0cf9b96..649e684 100644 (file)
@@ -1,5 +1,3 @@
 <?php
-// required for mod.php
 $MCONF['name'] = 'wizard_backend_layout';
-$MCONF['script'] = '_DISPATCH';
-$MCONF['access'] = '';
\ No newline at end of file
+$MCONF['script'] = '_DISPATCH';
\ No newline at end of file
index 0925375..9e2a5a7 100644 (file)
@@ -1,5 +1,3 @@
 <?php
-//required for mod.php
 $MCONF['name'] = 'wizard_colorpicker';
-$MCONF['script'] = '_DISPATCH';
-$MCONF['access'] = '';
+$MCONF['script'] = '_DISPATCH';
\ No newline at end of file
index 4997b04..8dcafd3 100644 (file)
@@ -1,5 +1,3 @@
 <?php
-//required for mod.php
 $MCONF['name'] = 'wizard_edit';
-$MCONF['script'] = '_DISPATCH';
-$MCONF['access'] = '';
+$MCONF['script'] = '_DISPATCH';
\ No newline at end of file
index 68ada9b..6651975 100644 (file)
@@ -1,5 +1,3 @@
 <?php
-//required for mod.php
 $MCONF['name'] = 'wizard_list';
-$MCONF['script'] = '_DISPATCH';
-$MCONF['access'] = '';
+$MCONF['script'] = '_DISPATCH';
\ No newline at end of file
index 8668eec..2ca1297 100644 (file)
@@ -1,5 +1,3 @@
 <?php
-//required for mod.php
 $MCONF['name'] = 'wizard_rte';
-$MCONF['script'] = '_DISPATCH';
-$MCONF['access'] = '';
+$MCONF['script'] = '_DISPATCH';
\ No newline at end of file
index c47cbac..4780d0b 100644 (file)
@@ -1,5 +1,4 @@
 <?php
-//required for mod.php
 $MCONF['name'] = 'wizard_table';
 $MCONF['script'] = '_DISPATCH';
-$MCONF['access'] = '';
+$MCONF['access'] = '';
\ No newline at end of file
index 9742c33..ea2c6d3 100644 (file)
@@ -1,5 +1,3 @@
 <?php
-//required for mod.php
 $MCONF['name'] = 'wizard_forms';
-$MCONF['script'] = '_DISPATCH';
-$MCONF['access'] = '';
+$MCONF['script'] = '_DISPATCH';
\ No newline at end of file
index d08ccc6..c339428 100644 (file)
@@ -367,7 +367,7 @@ class SystemEnvironmentBuilder {
         * - Directly called documentRoot/index.php (-> FE call or eiD include): index.php sets $relativePathPart to
         * empty string to hint this code that the document root is identical to the directory the script is located at.
         * - An indirect include of any Backend related script (-> a backend module, the install tool, or scripts like ajax.php).
-        * - A Backend script: This is the case for the mod.php dispatcher and other entry scripts like 'cli_dispatch.phpsh'
+        * - A Backend script: This is the case for the index.php dispatcher and other entry scripts like 'cli_dispatch.phpsh'
         * or 'ajax.php' that are located inside typo3/ directly. In this case the Bootstrap->run() command sets
         * 'typo3/' as $relativePathPart as base to calculate the document root.
         *
index f62ff8d..d4fbd16 100644 (file)
@@ -956,9 +956,9 @@ class ExtensionManagementUtility {
        }
 
        /**
-        * Adds a module path to $GLOBALS['TBE_MODULES'] for used with the module dispatcher, mod.php
+        * Adds a module path to $GLOBALS['TBE_MODULES'] for used with the module dispatcher, index.php
         * Used only for modules that are not placed in the main/sub menu hierarchy by the traditional mechanism of addModule()
-        * Examples for this is context menu functionality (like import/export) which runs as an independent module through mod.php
+        * Examples for this is context menu functionality (like import/export) which runs as an independent module through index.php
         * FOR USE IN ext_tables.php FILES
         * Example:  \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addModulePath('xMOD_tximpexp', \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($_EXTKEY).'app/');
         *
index 1323c4a..e4959b2 100644 (file)
@@ -5,7 +5,7 @@ Deprecation: #68141 - typo3/ajax.php
 Description
 ===========
 
-The ajax.php entry-point has been marked as deprecation. All AJAX requests in the Backend using the Ajax API are
+The ajax.php entry-point has been marked as deprecated. All AJAX requests in the Backend using the Ajax API are
 not affected as they automatically use index.php.
 
 
diff --git a/typo3/sysext/core/Documentation/Changelog/master/Deprecation-68183-Typo3modphp.rst b/typo3/sysext/core/Documentation/Changelog/master/Deprecation-68183-Typo3modphp.rst
new file mode 100644 (file)
index 0000000..9935cd4
--- /dev/null
@@ -0,0 +1,27 @@
+===================================
+Deprecation: #68183 - typo3/mod.php
+===================================
+
+Description
+===========
+
+The mod.php entry-point has been marked as deprecated. All Backend Module requests in the Backend using the Module Url API are
+not affected as they automatically use index.php.
+
+
+Impact
+======
+
+All extensions directly linking to typo3/mod.php will throw a deprecation warning.
+
+
+Affected Installations
+======================
+
+Installations with custom extensions that call typo3/mod.php without using proper API calls from ``BackendUtility``.
+
+
+Migration
+=========
+
+Use ``BackendUtility::getModuleUrl()``.
index a529a0b..6ca27ca 100644 (file)
@@ -1986,7 +1986,7 @@ class GeneralUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                        '../index.php' => array('../index.php'),
                        '../typo3/alt_intro.php' => array('../typo3/alt_intro.php'),
                        '../~userDirectory/index.php' => array('../~userDirectory/index.php'),
-                       '../typo3/mod.php?var1=test-case&var2=~user' => array('../typo3/mod.php?var1=test-case&var2=~user'),
+                       '../typo3/index.php?var1=test-case&var2=~user' => array('../typo3/index.php?var1=test-case&var2=~user'),
                        PATH_site . 'typo3/alt_intro.php' => array(PATH_site . 'typo3/alt_intro.php'),
                        $typo3SiteUrl . 'typo3/alt_intro.php' => array($typo3SiteUrl . 'typo3/alt_intro.php'),
                        $typo3RequestHost . $subDirectory . '/index.php' => array($typo3RequestHost . $subDirectory . '/index.php')
index 2db45d8..2ab71b3 100644 (file)
@@ -26,7 +26,7 @@ class ModuleRunner implements ModuleRunnerInterface {
        protected $objectManager;
 
        /**
-        * This method forwards the call to Bootstrap's run() method. This method is invoked by the mod.php
+        * This method forwards the call to Bootstrap's run() method. This method is invoked by the BackendModuleRequestHandler
         * function of TYPO3.
         *
         * @param string $moduleSignature
@@ -53,8 +53,8 @@ class ModuleRunner implements ModuleRunnerInterface {
                }
 
                // BACK_PATH is the path from the typo3/ directory from within the
-               // directory containing the controller file. We are using mod.php dispatcher
-               // and thus we are already within typo3/ because we call typo3/mod.php
+               // directory containing the controller file. We are using index.php dispatcher
+               // and thus we are already within typo3/ because we call typo3/index.php
                $GLOBALS['BACK_PATH'] = '';
                $configuration = array(
                        'extensionName' => $moduleConfiguration['extensionName'],
index b2e248b..f0ae3d5 100644 (file)
@@ -598,7 +598,7 @@ class UriBuilder {
 
        /**
         * Builds the URI, backend flavour
-        * The resulting URI is relative and starts with "mod.php".
+        * The resulting URI is relative and starts with "index.php".
         * The settings pageUid, pageType, noCache, useCacheHash & linkAccessRestrictedPages
         * will be ignored in the backend.
         *
index 9009771..bd5d46c 100644 (file)
@@ -234,7 +234,7 @@ class UriBuilderTest extends UnitTestCase {
                $_POST['foo2'] = 'bar2';
                $this->uriBuilder->setAddQueryString(TRUE);
                $this->uriBuilder->setAddQueryStringMethod('GET,POST');
-               $expectedResult = PATH_typo3 . 'mod.php?M=moduleKey&moduleToken=dummyToken&id=pageId&foo=bar&foo2=bar2';
+               $expectedResult = PATH_typo3 . 'index.php?M=moduleKey&moduleToken=dummyToken&id=pageId&foo=bar&foo2=bar2';
                $actualResult = $this->uriBuilder->buildBackendUri();
                $this->assertEquals($expectedResult, $actualResult);
        }
@@ -248,7 +248,7 @@ class UriBuilderTest extends UnitTestCase {
                $_POST['foo2'] = 'bar2';
                $this->uriBuilder->setAddQueryString(TRUE);
                $this->uriBuilder->setAddQueryStringMethod(NULL);
-               $expectedResult = PATH_typo3 . 'mod.php?M=moduleKey&moduleToken=dummyToken&id=pageId&foo=bar';
+               $expectedResult = PATH_typo3 . 'index.php?M=moduleKey&moduleToken=dummyToken&id=pageId&foo=bar';
                $actualResult = $this->uriBuilder->buildBackendUri();
                $this->assertEquals($expectedResult, $actualResult);
        }
@@ -271,7 +271,7 @@ class UriBuilderTest extends UnitTestCase {
                                        'M',
                                        'id'
                                ),
-                               PATH_typo3 . 'mod.php?moduleToken=dummyToken&foo=bar&foo2=bar2'
+                               PATH_typo3 . 'index.php?moduleToken=dummyToken&foo=bar&foo2=bar2'
                        ),
                        'Arguments to be excluded in the end' => array(
                                array(
@@ -286,7 +286,7 @@ class UriBuilderTest extends UnitTestCase {
                                        'M',
                                        'id'
                                ),
-                               PATH_typo3 . 'mod.php?moduleToken=dummyToken&foo=bar&foo2=bar2'
+                               PATH_typo3 . 'index.php?moduleToken=dummyToken&foo=bar&foo2=bar2'
                        ),
                        'Arguments in nested array to be excluded' => array(
                                array(
@@ -303,7 +303,7 @@ class UriBuilderTest extends UnitTestCase {
                                        'id',
                                        'tx_foo[bar]'
                                ),
-                               PATH_typo3 . 'mod.php?M=moduleKey&moduleToken=dummyToken&foo2=bar2'
+                               PATH_typo3 . 'index.php?M=moduleKey&moduleToken=dummyToken&foo2=bar2'
                        ),
                        'Arguments in multidimensional array to be excluded' => array(
                                array(
@@ -322,7 +322,7 @@ class UriBuilderTest extends UnitTestCase {
                                        'id',
                                        'tx_foo[bar][baz]'
                                ),
-                               PATH_typo3 . 'mod.php?M=moduleKey&moduleToken=dummyToken&foo2=bar2'
+                               PATH_typo3 . 'index.php?M=moduleKey&moduleToken=dummyToken&foo2=bar2'
                        ),
                );
        }
@@ -350,7 +350,7 @@ class UriBuilderTest extends UnitTestCase {
         */
        public function buildBackendUriKeepsModuleQueryParametersIfAddQueryStringIsNotSet() {
                GeneralUtility::_GETset(array('M' => 'moduleKey', 'id' => 'pageId', 'foo' => 'bar'));
-               $expectedResult = PATH_typo3 . 'mod.php?M=moduleKey&moduleToken=dummyToken&id=pageId';
+               $expectedResult = PATH_typo3 . 'index.php?M=moduleKey&moduleToken=dummyToken&id=pageId';
                $actualResult = $this->uriBuilder->buildBackendUri();
                $this->assertEquals($expectedResult, $actualResult);
        }
@@ -361,7 +361,7 @@ class UriBuilderTest extends UnitTestCase {
        public function buildBackendUriMergesAndOverrulesQueryParametersWithArguments() {
                GeneralUtility::_GETset(array('M' => 'moduleKey', 'id' => 'pageId', 'foo' => 'bar'));
                $this->uriBuilder->setArguments(array('M' => 'overwrittenModuleKey', 'somePrefix' => array('bar' => 'baz')));
-               $expectedResult = PATH_typo3 . 'mod.php?M=overwrittenModuleKey&moduleToken=dummyToken&id=pageId&somePrefix%5Bbar%5D=baz';
+               $expectedResult = PATH_typo3 . 'index.php?M=overwrittenModuleKey&moduleToken=dummyToken&id=pageId&somePrefix%5Bbar%5D=baz';
                $actualResult = $this->uriBuilder->buildBackendUri();
                $this->assertEquals($expectedResult, $actualResult);
        }
@@ -374,7 +374,7 @@ class UriBuilderTest extends UnitTestCase {
                $mockDomainObject = $this->getAccessibleMock(AbstractEntity::class, array('dummy'));
                $mockDomainObject->_set('uid', '123');
                $this->uriBuilder->setArguments(array('somePrefix' => array('someDomainObject' => $mockDomainObject)));
-               $expectedResult = PATH_typo3 . 'mod.php?M=moduleKey&moduleToken=dummyToken&somePrefix%5BsomeDomainObject%5D=123';
+               $expectedResult = PATH_typo3 . 'index.php?M=moduleKey&moduleToken=dummyToken&somePrefix%5BsomeDomainObject%5D=123';
                $actualResult = $this->uriBuilder->buildBackendUri();
                $this->assertEquals($expectedResult, $actualResult);
        }
@@ -385,7 +385,7 @@ class UriBuilderTest extends UnitTestCase {
        public function buildBackendUriRespectsSection() {
                GeneralUtility::_GETset(array('M' => 'moduleKey'));
                $this->uriBuilder->setSection('someSection');
-               $expectedResult = PATH_typo3 . 'mod.php?M=moduleKey&moduleToken=dummyToken#someSection';
+               $expectedResult = PATH_typo3 . 'index.php?M=moduleKey&moduleToken=dummyToken#someSection';
                $actualResult = $this->uriBuilder->buildBackendUri();
                $this->assertEquals($expectedResult, $actualResult);
        }
@@ -399,7 +399,7 @@ class UriBuilderTest extends UnitTestCase {
                $_SERVER['SCRIPT_NAME'] = '/typo3/index.php';
                $this->mockRequest->expects($this->any())->method('getBaseUri')->will($this->returnValue('http://baseuri'));
                $this->uriBuilder->setCreateAbsoluteUri(TRUE);
-               $expectedResult = 'http://baseuri/' . TYPO3_mainDir . 'mod.php?M=moduleKey&moduleToken=dummyToken';
+               $expectedResult = 'http://baseuri/' . TYPO3_mainDir . 'index.php?M=moduleKey&moduleToken=dummyToken';
                $actualResult = $this->uriBuilder->buildBackendUri();
                $this->assertSame($expectedResult, $actualResult);
        }
@@ -431,7 +431,7 @@ class UriBuilderTest extends UnitTestCase {
                );
                $this->uriBuilder->setAddQueryString(TRUE);
                $this->uriBuilder->setAddQueryStringMethod('POST,GET');
-               $expectedResult = $this->rawUrlEncodeSquareBracketsInUrl(PATH_typo3 . 'mod.php?moduleToken=dummyToken&key1=POST1&key2=GET2&key3[key31]=POST31&key3[key32]=GET32&key3[key33][key331]=GET331&key3[key33][key332]=POST332');
+               $expectedResult = $this->rawUrlEncodeSquareBracketsInUrl(PATH_typo3 . 'index.php?moduleToken=dummyToken&key1=POST1&key2=GET2&key3[key31]=POST31&key3[key32]=GET32&key3[key33][key331]=GET331&key3[key33][key332]=POST332');
                $actualResult = $this->uriBuilder->buildBackendUri();
                $this->assertEquals($expectedResult, $actualResult);
        }
@@ -463,7 +463,7 @@ class UriBuilderTest extends UnitTestCase {
                );
                $this->uriBuilder->setAddQueryString(TRUE);
                $this->uriBuilder->setAddQueryStringMethod('GET,POST');
-               $expectedResult = $this->rawUrlEncodeSquareBracketsInUrl(PATH_typo3 . 'mod.php?moduleToken=dummyToken&key1=GET1&key2=POST2&key3[key31]=GET31&key3[key32]=POST32&key3[key33][key331]=POST331&key3[key33][key332]=GET332');
+               $expectedResult = $this->rawUrlEncodeSquareBracketsInUrl(PATH_typo3 . 'index.php?moduleToken=dummyToken&key1=GET1&key2=POST2&key3[key31]=GET31&key3[key32]=POST32&key3[key33][key331]=POST331&key3[key33][key332]=GET332');
                $actualResult = $this->uriBuilder->buildBackendUri();
                $this->assertEquals($expectedResult, $actualResult);
        }
index f5aa472..2d4387f 100644 (file)
@@ -1,5 +1,3 @@
 <?php
-//required for mod.php
 $MCONF['name'] = 'wizard_form';
-$MCONF['script'] = '_DISPATCH';
-$MCONF['access'] = '';
\ No newline at end of file
+$MCONF['script'] = '_DISPATCH';
\ No newline at end of file
index 23c7704..87f3b05 100644 (file)
@@ -66,6 +66,8 @@ class SilentConfigurationUpgradeService {
                'INSTALL/wizardDone/TYPO3\\CMS\\Install\\Updates\\TceformsUpdateWizard',
                'INSTALL/wizardDone/TYPO3\\CMS\\Install\\Updates\\TtContentUploadsUpdateWizard',
                'INSTALL/wizardDone/TYPO3\\CMS\\Install\\Updates\\TruncateSysFileProcessedFileTable',
+               // #68183
+               'INSTALL/wizardDone/TYPO3\\CMS\\Install\\Updates\\MigrateShortcutUrlsUpdate',
                // #63818
                'BE/staticFileEditPath',
                // #64226
diff --git a/typo3/sysext/install/Classes/Updates/MigrateShortcutUrlsAgainUpdate.php b/typo3/sysext/install/Classes/Updates/MigrateShortcutUrlsAgainUpdate.php
new file mode 100644 (file)
index 0000000..1f1e798
--- /dev/null
@@ -0,0 +1,90 @@
+<?php
+namespace TYPO3\CMS\Install\Updates;
+
+/*
+ * This file is part of the TYPO3 CMS project.
+ *
+ * It is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License, either version 2
+ * of the License, or any later version.
+ *
+ * For the full copyright and license information, please read the
+ * LICENSE.txt file that was distributed with this source code.
+ *
+ * The TYPO3 project - inspiring people to share!
+ */
+
+/**
+ * Migrate backend shorcut urls
+ */
+class MigrateShortcutUrlsAgainUpdate extends AbstractUpdate {
+
+       /**
+        * @var string
+        */
+       protected $title = 'Migrate backend shortcut urls';
+
+       /**
+        * Checks if an update is needed
+        *
+        * @param string &$description The description for the update
+        * @return bool Whether an update is needed (TRUE) or not (FALSE)
+        */
+       public function checkForUpdate(&$description) {
+               $shortcutsCount = $this->getDatabaseConnection()->exec_SELECTcountRows('uid', 'sys_be_shortcuts');
+               if ($this->isWizardDone() || $shortcutsCount === 0) {
+                       return FALSE;
+               }
+
+               $description = 'Migrate old shorcut urls to the new module urls.';
+
+               return TRUE;
+       }
+
+       /**
+        * Performs the database update if shorcuts are available
+        *
+        * @param array &$databaseQueries Queries done in this update
+        * @param mixed &$customMessages Custom messages
+        * @return bool
+        */
+       public function performUpdate(array &$databaseQueries, &$customMessages) {
+               $db = $this->getDatabaseConnection();
+               $shortcuts = $db->exec_SELECTgetRows('uid,url', 'sys_be_shortcuts', '1=1');
+               if (!empty($shortcuts)) {
+                       foreach ($shortcuts as $shortcut) {
+                               $decodedUrl = urldecode($shortcut['url']);
+                               $encodedUrl = str_replace(
+                                       array(
+                                               '/typo3/sysext/cms/layout/db_layout.php?&',
+                                               '/typo3/sysext/cms/layout/db_layout.php?',
+                                               '/typo3/file_edit.php?&',
+                                               // From 7.2 to 7.4
+                                               'mod.php',
+                                       ),
+                                       array(
+                                               '/typo3/index.php?&M=web_layout&',
+                                               urlencode('/typo3/index.php?&M=web_layout&'),
+                                               '/typo3/index.php?&M=file_edit&',
+                                               // From 7.2 to 7.4
+                                               'index.php',
+                                       ),
+                                       $decodedUrl
+                               );
+
+                               $db->exec_UPDATEquery(
+                                       'sys_be_shortcuts',
+                                       'uid=' . (int)$shortcut['uid'],
+                                       array(
+                                               'url' => $encodedUrl,
+                                       )
+                               );
+                               $databaseQueries[] = $db->debug_lastBuiltQuery;
+                       }
+               }
+
+               $this->markWizardAsDone();
+               return TRUE;
+       }
+
+}
diff --git a/typo3/sysext/install/Classes/Updates/MigrateShortcutUrlsUpdate.php b/typo3/sysext/install/Classes/Updates/MigrateShortcutUrlsUpdate.php
deleted file mode 100644 (file)
index 5f19ff7..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-<?php
-namespace TYPO3\CMS\Install\Updates;
-
-/*
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-/**
- * Migrate backend shorcut urls
- */
-class MigrateShortcutUrlsUpdate extends AbstractUpdate {
-
-       /**
-        * @var string
-        */
-       protected $title = 'Migrate backend shortcut urls';
-
-       /**
-        * Checks if an update is needed
-        *
-        * @param string &$description The description for the update
-        * @return bool Whether an update is needed (TRUE) or not (FALSE)
-        */
-       public function checkForUpdate(&$description) {
-               $shortcutsCount = $this->getDatabaseConnection()->exec_SELECTcountRows('uid', 'sys_be_shortcuts');
-               if ($this->isWizardDone() || $shortcutsCount === 0) {
-                       return FALSE;
-               }
-
-               $description = 'Migrate old shorcut urls to the new module urls.';
-
-               return TRUE;
-       }
-
-       /**
-        * Performs the database update if shorcuts are available
-        *
-        * @param array &$databaseQueries Queries done in this update
-        * @param mixed &$customMessages Custom messages
-        * @return bool
-        */
-       public function performUpdate(array &$databaseQueries, &$customMessages) {
-               $db = $this->getDatabaseConnection();
-               $shortcuts = $db->exec_SELECTgetRows('uid,url', 'sys_be_shortcuts', '1=1');
-               if (!empty($shortcuts)) {
-                       foreach ($shortcuts as $shortcut) {
-                               $decodedUrl = urldecode($shortcut['url']);
-                               $encodedUrl = str_replace(
-                                       array(
-                                               '/typo3/sysext/cms/layout/db_layout.php?&',
-                                               '/typo3/sysext/cms/layout/db_layout.php?',
-                                               '/typo3/file_edit.php?&',
-                                       ),
-                                       array(
-                                               '/typo3/mod.php?&M=web_layout&',
-                                               urlencode('/typo3/mod.php?&M=web_layout&'),
-                                               '/typo3/mod.php?&M=file_edit&',
-                                       ),
-                                       $decodedUrl
-                               );
-
-                               $db->exec_UPDATEquery(
-                                       'sys_be_shortcuts',
-                                       'uid=' . (int)$shortcut['uid'],
-                                       array(
-                                               'url' => $encodedUrl,
-                                       )
-                               );
-                               $databaseQueries[] = $db->debug_lastBuiltQuery;
-                       }
-               }
-
-               $this->markWizardAsDone();
-               return TRUE;
-       }
-
-}
index c48b086..a404b85 100644 (file)
@@ -5,7 +5,7 @@ defined('TYPO3_MODE') or die();
 $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install']['update']['backendUserStartModule'] = \TYPO3\CMS\Install\Updates\BackendUserStartModuleUpdate::class;
 $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install']['update']['languageIsoCode'] = \TYPO3\CMS\Install\Updates\LanguageIsoCodeUpdate::class;
 $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install']['update']['PageShortcutParent'] = \TYPO3\CMS\Install\Updates\PageShortcutParentUpdate::class;
-$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install']['update']['backendShortcuts'] = \TYPO3\CMS\Install\Updates\MigrateShortcutUrlsUpdate::class;
+$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install']['update']['backendShortcuts'] = \TYPO3\CMS\Install\Updates\MigrateShortcutUrlsAgainUpdate::class;
 $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install']['update']['processedFilesChecksum'] = \TYPO3\CMS\Install\Updates\ProcessedFileChecksumUpdate::class;
 $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install']['update']['filesReplacePermission'] = \TYPO3\CMS\Install\Updates\FilesReplacePermissionUpdate::class;
 $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install']['update']['tableCType'] = \TYPO3\CMS\Install\Updates\TableFlexFormToTtContentFieldsUpdate::class;
index f6dfdc3..1c2d1d5 100644 (file)
@@ -1,5 +1,3 @@
 <?php
-//required for mod.php
 $MCONF['name'] = 'wizard_openid';
-$MCONF['script'] = '_DISPATCH';
-$MCONF['access'] = '';
+$MCONF['script'] = '_DISPATCH';
\ No newline at end of file
index 14907f0..6122409 100644 (file)
@@ -1,5 +1,3 @@
 <?php
-//required for mod.php
 $MCONF['name'] = 'wizard_browse_links';
-$MCONF['script'] = '_DISPATCH';
-$MCONF['access'] = '';
+$MCONF['script'] = '_DISPATCH';
\ No newline at end of file