Project

General

Profile

Actions

Bug #83548

closed

TYPO3 9.0.0 Extbase: Validation in Controller Actions are broken

Added by Alex Kellner over 6 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2018-01-12
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
9
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

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

Actions #1

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

Actions

Also available in: Atom PDF