Bug #83425

Custom validators

Added by Frank Buijze almost 2 years ago. Updated about 1 year ago.

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

100%

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) Closed 2017-10-08
Related to TYPO3 Core - Feature #83167: Replace @validate with @Extbase\Validate Closed 2017-11-29

Associated revisions

Revision 80e78c98 (diff)
Added by Alexander Schnitzler almost 2 years ago

[BUGFIX] Fix resolving of method validators

This is a regression bugfix. During the ClassSchema refactoring
the resolving of method validators broke due to stripping of
beginning dollar signs from tags.

Releases: master
Resolves: #83425
Change-Id: Ida33ade7bc61c0bb926fbf1895612eac9a94d948
Reviewed-on: https://review.typo3.org/55244
Tested-by: TYPO3com <>
Reviewed-by: Georg Ringer <>
Tested-by: Georg Ringer <>
Reviewed-by: Anja Leichsenring <>
Tested-by: Anja Leichsenring <>
Reviewed-by: Christian Kuhn <>
Tested-by: Christian Kuhn <>

History

#1 Updated by Georg Ringer almost 2 years ago

  • Description updated (diff)

#2 Updated by Georg Ringer almost 2 years ago

  • Is Regression set to Yes

#3 Updated by Georg Ringer almost 2 years ago

  • Related to Epic #82703: Introduce doctrine/annotations to replace user defined annotations (mostly in Extbase) added

#4 Updated by Georg Ringer almost 2 years ago

  • Related to Feature #83167: Replace @validate with @Extbase\Validate added

#5 Updated by Susanne Moog almost 2 years ago

  • Assignee set to Alexander Schnitzler

#6 Updated by Gerrit Code Review almost 2 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55244

#7 Updated by Gerrit Code Review almost 2 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55244

#8 Updated by Gerrit Code Review almost 2 years ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55244

#9 Updated by Gerrit Code Review almost 2 years ago

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55244

#10 Updated by Gerrit Code Review almost 2 years ago

Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55244

#11 Updated by Gerrit Code Review almost 2 years ago

Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55244

#12 Updated by Anonymous almost 2 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#13 Updated by Benni Mack about 1 year ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF