Issue Bug Closed

#62545Record type constraints of subclasses prevent loading of parent class objects

Frederik Vosberg 10/29/14, 21:21 updated 12/02/16, 15:25

Description

Hi there,

following scenario:

class Mother {
}

class Daughter extends Mother {
}

config.tx_extbase.persistence.classes {
Mother {
mapping {
tableName = tt_content
}
}

Rattazonk\Extbasepages\Domain\Model\Content\Shortcut {
mapping.recordType = littleGirl
}
Mother.subclasses.1414596636 = Daughter
}

I had a mother class for some tt_content types. Now I found a special case and needed polymorphism, so I implemented the Daughter class with the recordType littleGirl. So the DaughterRepository only returns little girls. But the MotherRepository doesnt work anymore because of a constraint for types because of the subclasses type constraint.

Already wrote a patch, I am going to upload it to gerrit.

So as a summary:

A subclass with a defined recordType in extbase breaks a parent class without a type.

Reviews 1