Project

General

Profile

Actions

Bug #91029

open

Validation fails if nested properties of same type are present

Added by Daniel Schultheis about 4 years ago. Updated about 3 years ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
Extbase
Target version:
-
Start date:
2020-04-14
Due date:
% Done:

0%

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

Description

I recently stumbled upon an issue regarding the validation process and after some debugging I was able to track down the problem to be exactly the same problem that has already been fixed years ago in the FLOW framework:

https://forge.typo3.org/issues/50585

Long story short:

The validate() methods in
  • TYPO3\CMS\Extbase\Validation\Validator\AbstractValidator
  • TYPO3\CMS\Extbase\Validation\Validator\CollectionValidator
  • TYPO3\CMS\Extbase\Validation\Validator\GenericObjectValidator
    will override $this->result every time they are called not preserving previous error results that might eventually already exist.

In the FLOW framework this is being handled by pushing the previous error result on a stack before the isValid() method is being processed and then popped backed out again afterwards.

See here as an example:
https://github.com/neos/flow/blob/master/Classes/Validation/Validator/AbstractValidator.php#L150

It also looks like this problem still exists in TYPO3 10.x as the validators mentioned above still look the same as in TYPO3 9.5


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #89971: Extbase validation broken since merge of "58833: [BUGFIX] Keep existing validation errors for recursive domain relations"Rejected

Actions
Actions

Also available in: Atom PDF