[TYPO3-mvc] Update "does not happen"

Steffen Ritter info at rs-websystems.de
Wed Aug 25 13:26:35 CEST 2010


Am 25.08.2010 08:43, schrieb Steffen Ritter:
> Hey list,
> i have an action just fetching an object, setting an Param, putting it
> to repository->update();
> and assigning it to the view. an debug in view as well as in the
> controller shows that the object is "dirty".
>
> But the object is not persisted. Where should I start searching? Any hints?

Ok: Bug found :)
I "debugged me" through the persistence Layer and found the cause: 
SingleTable-Inheritance in combination with detection of objects to update.

I have 2 different user types and one repository for AbstractFEUsers, 
which delivers the correct object-types due to single-table-inheritence.

Objects which are modified are stored in 
'session->reconstitudedObjects'. In Order to avoid "double" persistence 
only aggregate-root objects get persisted. This is detected by checking 
if there is a repository class for the object. (Se line 169ff. in 
Classes/Persistence/Manager).
This for sure will fail with SingleTableInheritance and only one Repository.

As a workaround i just created "empty" repositories for all 
"subclasses". In long term this has to be fixed I think.
I'm not sure, if we should "detect" aggregate roots a completely other 
way or just "walking up" the inheritance tree to check if there is a 
repository for a parent class.

regards

Steffen


More information about the TYPO3-project-typo3v4mvc mailing list