Bug #83425

Custom validators

Added by Frank Buijze over 3 years ago. Updated almost 3 years ago.

Status:
Closed
Priority:
Must have
Category:
-
Target version:
-
Start date:
2017-12-25
Due date:
% Done:

100%

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

Description

Parsing goes wrong in case of @validate in combination with a custom validator. The problem is that the $ sign gets stripped (in tags), resulting in a failure of the parseValidatorAnnotation function in TYPO3/CMS/Extbase/Classes/Validation/ValidatorResolver.php. The function is called from the new getMethodValidateAnnotations in the same class.

Apparently this function still uses the tags and not the new annotations approach. The validators array annotations/contains the correct value.

If I dump the ClassSchema I see the following:

[tags] => Array
                        (
                            [param] => Array
                                (
                                    [0] => \FraJaWeB\FwCore\Domain\Model\User $user
                                    [1] => string $username
                                )

                            [validate] => Array
                                (
                                    [0] => user \FraJaWeB\FwCore\Domain\Validator\User2Validator
                                )

                        )

                    [annotations] => Array
                        (
                            [validators] => Array
                                (
                                    [0] => $user \FraJaWeB\FwCore\Domain\Validator\User2Validator
                                )

                        )


Related issues

Related to TYPO3 Core - Epic #82703: Introduce doctrine/annotations to replace user defined annotations (mostly in Extbase)ClosedAlexander Schnitzler2017-10-08

Actions
Related to TYPO3 Core - Feature #83167: Replace @validate with @Extbase\ValidateClosedAlexander Schnitzler2017-11-29

Actions

Also available in: Atom PDF