Bug #90480
closedresolveControllerAliasFromControllerClassName returns wrong alias
100%
Description
The new method to resolve an alias from the given controller class name in ExtensionUtility::configurePlugin does not respect any subdirectories in the controller directory.
As a result, the corresponding template of the controller is not found, because the wrong directory is searched.
An example how it works in TYPO3 v8 and v9:
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
'Extcode.cart',
'MiniCart',
[
'Cart\CartPreview' => 'show',
'Cart\Currency' => 'update',
],
// non-cacheable actions
[
'Cart\CartPreview' => 'show',
'Cart\Currency' => 'update',
]
);
There is a controller \Extcode\Cart\Controller\Cart\CartPreviewController
according to the plugin registration above. For the actions of the controller the templates are located in Resources/Private/Templates/Cart/CartPreview
.
The new plugin registration looks like this.
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
'Cart',
'MiniCart',
[
\Extcode\Cart\Controller\Cart\CartPreviewController::class => 'show',
\Extcode\Cart\Controller\Cart\CurrencyController::class => 'update',
],
// non-cacheable actions
[
\Extcode\Cart\Controller\Cart\CartPreviewController::class => 'show',
\Extcode\Cart\Controller\Cart\CurrencyController::class => 'update',
]
);
The new method generates an alias from the given class name. To generate this alias, only the last part of the class name is used, not the entire namespace.
The method should return Cart\CartPreview
instead of Cart\CartPreview
.
Updated by Gerrit Code Review almost 5 years ago
- Status changed from New to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/63361
Updated by Gerrit Code Review almost 5 years ago
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/63361
Updated by Gerrit Code Review almost 5 years ago
Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/63361
Updated by Alexander Schnitzler over 4 years ago
The method should return Cart\CartPreview instead of Cart\CartPreview.
I guess you mean: The method should return Cart\CartPreview instead of just CartPreview?
Updated by Gerrit Code Review over 4 years ago
Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/63361
Updated by Daniel Gohlke over 4 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 6db9a9dccdfb5673449e77d2412f2c842ca79df3.