Bug #89971
Updated by Stephan Großberndt almost 5 years ago
Change https://review.typo3.org/c/Packages/TYPO3.CMS/+/58833 breaks usage of extbase validation in at least TYPO3 8.7. h3. With PHP 7.0 I see weird effects for this code: <pre> class MyAbstractModel extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {} class MyModel extends MyAbstractModel { /** * @var int * @validate \Vendor\Extension\Domain\Validator\NumberRangeNull \SideBySite\NvrIsa\Domain\Validator\NumberRangeNull (minimum = 0, maximum = 15) */ protected $myInteger; } </pre> <pre> $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 (!) } </pre> 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. h3. 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: <pre> 32211 Killed /home/mysite/www/typo3/sysext/core/bin/typo3 $@ </pre> syslog: <pre> 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 </pre>