Bug #83548
closedTYPO3 9.0.0 Extbase: Validation in Controller Actions are broken
0%
Description
I'm facing an issue in powermail in TYPO3 9 together with validation of controller actions.
Submitting forms are leading to an exception:
#1239853109: Invalid validate annotation in In2code\Powermail\Controller\FormController->createAction(): Could not resolve class name for validator "mail".
Like it's described in https://docs.typo3.org/typo3cms/ExtbaseFluidBook/9-CrosscuttingConcerns/2-validating-domain-objects.html#validating-of-controller-arguments it should be possible to validate an action like
@validate $param Path/To/Validator
Debugging extbase leads to a refactored method in \TYPO3\CMS\Extbase\Reflection\ReflectionService::getMethodTagsValues() (which is called from \TYPO3\CMS\Extbase\Validation\ValidatorResolver::getMethodValidateAnnotations())
While the old one returns a correct array:
[ param => [...] validate => ['$mail In2code\Powermail\Domain\Validator\UploadValidator'] return => [...] ]
The new one does the same but without a leading $:
[ param => [...] validate => ['mail In2code\Powermail\Domain\Validator\UploadValidator'] return => [...] ]
Hacking it and adding a $ seems to solve the problem.
TYPO3 9.0.0 - installed a day ago via
composer require typo3/minimal
Updated by Georg Ringer over 6 years ago
- Status changed from New to Closed
This is a duplicate and solved already in master, therefore I close the issue