[TASK] Use FQCN's when registering plugins/modules 66/59566/11
authorAlexander Schnitzler <git@alexanderschnitzler.de>
Thu, 24 Jan 2019 18:02:33 +0000 (19:02 +0100)
committerAnja Leichsenring <aleichsenring@ab-softlab.de>
Fri, 1 Feb 2019 09:30:11 +0000 (10:30 +0100)
commite67b6cf1ce74f302c4b904faab40c10b4598529d
tree629413726f57fc48975876708c3bbfc72cd2320f
parente4e01dd4cd8b48730e7b5e4f99f2460772345f6b
[TASK] Use FQCN's when registering plugins/modules

The following methods used controller aliases:

- \TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin
- \TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerModule

This means, that while configuring plugins or modules, a list
of controllers (and their actions) had to be provided, so they
could be registered as available controllers for said plugin
or module.

The controller name used for the registration, was kind of an
alias for that controller. It was the class name without the
namespace and without the "Controller" suffix. By a certain
convention a proper class name could be derived from that
alias. All this was necessary back then when TYPO3 didn't have
a proper autoloader and when the class location was derived
from the class name. These circumstances do not exist any more
and since it's only important that a controller class exists,
the registration of plugins must now use the fully qualified
controller class name as array key.

The former syntax

   \TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
       'TYPO3.CMS.IndexedSearch',
       'Pi2',
       ['Search' => 'form,search,noTypoScript'],
       ['Search' => 'form,search']
   );

has to be converted to

   \TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
       'IndexedSearch',
       'Pi2',
       [
           \TYPO3\CMS\IndexedSearch\Controller\SearchController::class
               => 'form,search,noTypoScript'
       ],
       [
           \TYPO3\CMS\IndexedSearch\Controller\SearchController::class
               => 'form,search'
       ]
   );

Please note, that not only the controller configuration changed.
The vendor `TYPO3.CMS` in `TYPO3.CMS.IndexedSearch`, must no longer
be set. Instead, the vendor will be evaluated by looking at the
controller namespace.

Releases: master
Resolves: #87550
Change-Id: If47d087836c4345a8180dae3d4e4b8cd384e684c
Reviewed-on: https://review.typo3.org/59566
Tested-by: TYPO3com <noreply@typo3.com>
Reviewed-by: Jörg Bösche <typo3@joergboesche.de>
Reviewed-by: Mona Muzaffar <mona.muzaffar@gmx.de>
Tested-by: Mona Muzaffar <mona.muzaffar@gmx.de>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
32 files changed:
composer.json
typo3/sysext/belog/ext_tables.php
typo3/sysext/beuser/ext_tables.php
typo3/sysext/core/Documentation/Changelog/master/Deprecation-87550-UseControllerClassesWhenRegisteringPluginsmodules.rst [new file with mode: 0644]
typo3/sysext/core/Tests/Functional/Fixtures/Extensions/irre_tutorial/ext_localconf.php
typo3/sysext/extbase/Classes/Core/Bootstrap.php
typo3/sysext/extbase/Classes/Mvc/Controller/AbstractController.php
typo3/sysext/extbase/Classes/Mvc/Request.php
typo3/sysext/extbase/Classes/Mvc/Web/FrontendRequestHandler.php
typo3/sysext/extbase/Classes/Mvc/Web/Request.php
typo3/sysext/extbase/Classes/Mvc/Web/RequestBuilder.php
typo3/sysext/extbase/Classes/Service/ExtensionService.php
typo3/sysext/extbase/Classes/Utility/ExtensionUtility.php
typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/blog_example/ext_localconf.php
typo3/sysext/extbase/Tests/Unit/Mvc/Controller/AbstractControllerTest.php
typo3/sysext/extbase/Tests/Unit/Mvc/Controller/ActionControllerTest.php
typo3/sysext/extbase/Tests/Unit/Mvc/RequestTest.php
typo3/sysext/extbase/Tests/Unit/Mvc/Web/RequestBuilderTest.php
typo3/sysext/extbase/Tests/Unit/Utility/ExtensionUtilityTest.php
typo3/sysext/extbase/Tests/Unit/Utility/Fixtures/MyExtension/Controller/FirstController.php [new file with mode: 0644]
typo3/sysext/extbase/Tests/Unit/Utility/Fixtures/MyExtension/Controller/SecondController.php [new file with mode: 0644]
typo3/sysext/extbase/Tests/Unit/Utility/Fixtures/MyExtension/Controller/ThirdController.php [new file with mode: 0644]
typo3/sysext/extbase/Tests/UnitDeprecated/Utility/ExtensionUtilityTest.php [new file with mode: 0644]
typo3/sysext/extensionmanager/ext_tables.php
typo3/sysext/filelist/ext_tables.php
typo3/sysext/fluid/Tests/Functional/View/TemplatesPathsTest.php
typo3/sysext/form/ext_localconf.php
typo3/sysext/form/ext_tables.php
typo3/sysext/indexed_search/ext_localconf.php
typo3/sysext/indexed_search/ext_tables.php
typo3/sysext/install/Configuration/ExtensionScanner/Php/MethodCallStaticMatcher.php
typo3/sysext/workspaces/ext_tables.php