Task #87550

Use controller classes when registering plugins/modules

Added by Alexander Schnitzler 6 months ago. Updated 2 months ago.

Status:
Closed
Priority:
Should have
Category:
Extbase
Start date:
2019-01-25
Due date:
% Done:

100%

TYPO3 Version:
10
PHP Version:
7.2
Tags:
Complexity:
Sprint Focus:

Related issues

Related to TYPO3 Core - Bug #88513: Non-FQCN controllers should still be usable in Extbase Resolved 2019-06-06

Associated revisions

Revision e67b6cf1 (diff)
Added by Alexander Schnitzler 6 months ago

[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 <>
Reviewed-by: Jörg Bösche <>
Reviewed-by: Mona Muzaffar <>
Tested-by: Mona Muzaffar <>
Reviewed-by: Anja Leichsenring <>
Tested-by: Anja Leichsenring <>

History

#1 Updated by Gerrit Code Review 6 months ago

  • Status changed from New to Under Review

Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/59566

#2 Updated by Gerrit Code Review 6 months ago

Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/59566

#3 Updated by Gerrit Code Review 6 months ago

Patch set 7 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/59566

#4 Updated by Gerrit Code Review 6 months ago

Patch set 8 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/59566

#5 Updated by Gerrit Code Review 6 months ago

Patch set 9 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/59566

#6 Updated by Gerrit Code Review 6 months ago

Patch set 10 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/59566

#7 Updated by Anonymous 6 months ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#8 Updated by Benni Mack 2 months ago

  • Status changed from Resolved to Closed

#9 Updated by Oliver Hader about 1 month ago

  • Related to Bug #88513: Non-FQCN controllers should still be usable in Extbase added

Also available in: Atom PDF