#96332Dependency injection not working for extbase validators
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.
Reviews 3
Related issues 5
- Task #92238Avoid usage of object manager in validation related classes
- Task #94384Avoid ObjectManager in remaining ext:form places
- Task #94451Avoid ObjectManager in ext:extbase
- Task #95026[TASK] Add missing breaking.rst about service injection in Extbase validators
- Task #96998Streamline Extbase validators