Project

General

Profile

Actions

Bug #78394

open

Property and object validators of child classes in STI are ignored

Added by Viktor Livakivskyi about 8 years ago. Updated over 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

Also available in: Atom PDF