Actions
Bug #78394
openProperty and object validators of child classes in STI are ignored
Status:
New
Priority:
Should have
Assignee:
-
Category:
Extbase
Target version:
-
Start date:
2016-10-24
Due date:
% Done:
0%
Estimated time:
TYPO3 Version:
7
PHP Version:
5.6
Tags:
Complexity:
Is Regression:
No
Sprint Focus:
Description
Hi.
In a case, when STI is used it is not possible to override property validators in child classes.
Consider a structure like this:
abstract class Parent { /** * @var string * @validate NotEmpty */ protected $title; /** * @var string */ protected $type; /* getters, setters and domain logic */ } class ChildOne { /** * @var string * @validate NotEmpty * @validate RegularExpression(regularExpression=/^start/) */ protected $title; } class ChildTwo { /** * @var string * @validate NotEmpty */ protected $title; }
All the TS settings for STI are correct, special TypeConverter exists and objects of corresponding types are correctly created and written into db.
However, for ChildOne
only NotEmptyValidator is executed.
If I move the regexp validation statement from child to parent - then it is executed as well.
Expected behavior: execute RegularExpressionValidator for ChildOne
.
Updated by Viktor Livakivskyi about 8 years ago
- Subject changed from Property validators of child classes in STI are ignored to Property and object validators of child classes in STI are ignored
Update: same applies for Domain Model Validators as well - ChildOneValidator will be ignored, while ParentValidator will be executed.
Updated by Michael Grundkötter about 7 years ago
- Related to Bug #82847: extbase model object validation does not care for overwritten classes added
Actions