Project

General

Profile

Actions

Bug #78394

open

Property and object validators of child classes in STI are ignored

Added by Viktor Livakivskyi over 7 years ago. Updated about 4 years ago.

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.


Related issues 1 (1 open0 closed)

Related to TYPO3 Core - Bug #82847: extbase model object validation does not care for overwritten classesNew2017-10-24

Actions
Actions #1

Updated by Viktor Livakivskyi over 7 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.

Actions #2

Updated by Michael Grundkötter over 6 years ago

  • Related to Bug #82847: extbase model object validation does not care for overwritten classes added
Actions #3

Updated by Christian Eßl about 4 years ago

  • Category set to Extbase
Actions

Also available in: Atom PDF