Project

General

Profile

Actions

Bug #89971

closed

Extbase validation broken since merge of "58833: [BUGFIX] Keep existing validation errors for recursive domain relations"

Added by Stephan Großberndt over 4 years ago. Updated almost 4 years ago.

Status:
Rejected
Priority:
-- undefined --
Assignee:
-
Category:
Extbase
Target version:
-
Start date:
Due date:
% Done:

0%

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

Description

Change https://review.typo3.org/c/Packages/TYPO3.CMS/+/58833 breaks usage of extbase validation in at least TYPO3 8.7.

With PHP 7.0 I see weird effects for this code:

class MyAbstractModel extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {}

class MyModel extends MyAbstractModel {

/**
* @var int
* @validate \Vendor\Extension\Domain\Validator\NumberRangeNull (minimum = 0, maximum = 15)
*/
protected $myInteger;
}
$objectsData = [16,0];
foreach ($objectsData as $objectData) {
  $myModel = $this->objectManager->get(Domain\Model\MyModel::class);
  $myModel->setMyInteger($objectData);
  $validator = $this->validatorResolver->getBaseValidatorConjunction(Domain\Model\MyModel::class);
  $validatorResults = $validator->validate($object);
  var_dump($myModel->getMyInteger()); # returns 16 for first $myModel and 0 for second $myModel
  var_dump($validatorResults); # returns object(TYPO3\CMS\Extbase\Error\Result)#112081 for BOTH $myModel (!)
}

Running the code with change #58833 the $validatorResults for the second object contain exactly the SAME object(TYPO3\CMS\Extbase\Error\Result)#112081 stating that the second object is invalid while it is not.

If I revert change #58833 the code runs without issues.

With PHP 7.2 the effects are even worse (!):

During validation of a certain object the PHP CLI process executing eats up all RAM and dies:

32211 Killed /home/mysite/www/typo3/sysext/core/bin/typo3 $@

syslog:

winbindd invoked oom-killer: gfp_mask=0x201da, order=0, oom_score_adj=0
[ pid ]   uid  tgid total_vm      rss nr_ptes swapents oom_score_adj name
[32211]     0 32211  3154075  1901446    6144   795905             0 php
Out of memory: Kill process 32211 (php) score 633 or sacrifice child
Killed process 32211 (php) total-vm:12616300kB, anon-rss:7605736kB, file-rss:48kB


Related issues 2 (1 open1 closed)

Related to TYPO3 Core - Bug #91029: Validation fails if nested properties of same type are presentNew2020-04-14

Actions
Follows TYPO3 Core - Bug #84475: Validation skipped for domain-record with circular relationship on itself on submitting nested formClosed2018-03-19

Actions
Actions

Also available in: Atom PDF