Bug #52607

Domain Model validators are executed twice

Added by Marc Bastian Heinrichs almost 2 years ago. Updated 5 months ago.

Status:Resolved Start date:2013-10-08
Priority:Should have Due date:
Assigned To:Alexander Schnitzler % Done:

100%

Category:Extbase Spent time: -
Target version:next-patchlevel
TYPO3 Version:6.2 Is Regression:No
PHP Version: Sprint Focus:
Complexity:

Description

Fix for this needs to be backported from Flow

@see #49624


Related issues

related to TYPO3.Flow - Bug #49624: Domain Model validators are executed twice Resolved 2013-07-03
related to Core - Bug #62500: Validator based on DataType of controller-action argument... Closed 2014-10-27

Associated revisions

Revision e5c3c6cb
Added by Alexander Schnitzler 5 months ago

[BUGFIX] Add domain model validators only once

If a domain model validator is present and a controller
action accepts this domain model as argument, the validator
is added twice to the validation tree.

It is added in
ValidatorResolver::buildMethodArgumentsValidatorConjunctions()
and in ValidatorResolver::addCustomValidators() which is called
from ValidatorResolver::getBaseValidatorConjunction()

Both methods are called when building the validation tree in
ActionController::initializeActionMethodValidators()

Resolves: #52607
Releases: master, 6.2
Change-Id: Ic1674bacfb027840d9b8fcd1d66586ebb0e75ad6
Reviewed-on: http://review.typo3.org/36915
Reviewed-by: Patrick Schriner <>
Tested-by: Patrick Schriner <>
Reviewed-by: Stefan Neufeind <>
Tested-by: Andy Grunwald <>
Reviewed-by: Wouter Wolters <>
Reviewed-by: Helmut Hummel <>
Tested-by: Helmut Hummel <>

Revision ae317f2a
Added by Alexander Schnitzler 5 months ago

[BUGFIX] Add domain model validators only once

If a domain model validator is present and a controller
action accepts this domain model as argument, the validator
is added twice to the validation tree.

It is added in
ValidatorResolver::buildMethodArgumentsValidatorConjunctions()
and in ValidatorResolver::addCustomValidators() which is called
from ValidatorResolver::getBaseValidatorConjunction()

Both methods are called when building the validation tree in
ActionController::initializeActionMethodValidators()

Resolves: #52607
Releases: master, 6.2
Change-Id: Ic1674bacfb027840d9b8fcd1d66586ebb0e75ad6
Reviewed-on: http://review.typo3.org/37579
Reviewed-by: Markus Klein <>
Tested-by: Markus Klein <>

History

#1 Updated by Andreas Allacher over 1 year ago

Should be included before final v6.2 LTS

Currently the validators are called double. The issue was introduced most likely with this change:
https://git.typo3.org/Packages/TYPO3.CMS.git/commit/66fb0ad5c6755089db014cd329357898632bf444

because now the validator is found via buildMethodArgumentsValidatorConjunctions and buildBaseValidatorConjunction and added on both parts.

#2 Updated by Online Now! GmbH 12 months ago

Bug is still present in TYPO3 6.2.4. Also if you add an annotation @validate with the validator before a controller action, the validator gets executed three times. Only workaround in the mean time is to put the validators not in the \Domain\Validator directory or modify the Extbase source code.

#3 Updated by Alexander Opitz 10 months ago

  • Project changed from Extbase MVC Framework to Core
  • Category changed from Extbase: Validation to Extbase
  • Target version changed from Extbase 6.2 to next-patchlevel
  • TYPO3 Version set to 6.2
  • Is Regression set to No

#4 Updated by Alexander Schnitzler 6 months ago

  • Status changed from New to Accepted
  • Assigned To set to Alexander Schnitzler

#5 Updated by Gerrit Code Review 6 months ago

  • Status changed from Accepted 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 http://review.typo3.org/36915

#6 Updated by Anonymous 5 months ago

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

#7 Updated by Gerrit Code Review 5 months ago

  • Status changed from Resolved to Under Review

Patch set 1 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/37579

#8 Updated by Anonymous 5 months ago

  • Status changed from Under Review to Resolved

Also available in: Atom PDF