Actions
Bug #96332
closedDependency injection not working for extbase validators
Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Extbase
Target version:
-
Start date:
2021-12-10
Due date:
% Done:
100%
Estimated time:
TYPO3 Version:
11
PHP Version:
7.4
Tags:
extbase,DI
Complexity:
Is Regression:
Sprint Focus:
Description
(Found by testing powermail in TYPO3 version 11.)
In \TYPO3\CMS\Extbase\Mvc\Controller\ActionController->initializeActionMethodValidators() the validators are instantiated by calling
$validatorInstance = GeneralUtility::makeInstance(
$validatorDefinition['className'],
$validatorDefinition['options']
);
however, when options for the given validator are empty, the empty array will get passed to GeneralUtility::makeInstance() as the first argument. Therefore, the check for empty constructorArguments will fail in GeneralUtility::makeInstance() and the class will not be instantiated by the DI container.
Actions