[TYPO3-mvc] deleteAll : none of the foreign table rows are marked as deleted

Jochen Rau jochen.rau at typoplanet.de
Tue Jul 21 22:48:21 CEST 2009


Hi Julian.

Julian Kleinhans wrote:
> first of all, absolutley great job!!! Big thanks for that!
> After my first testcase i have found the following bug!

Thanks. Credit goes to the FLOW3 team.

> Extension: blog_example
> I create some example data and after that step i delete all blogs!
>
> Open the database and look at the table
> tx_blogexample_domain_model_blog, all rows marked as deleted
>
> Then, look at table tx_blogexample_domain_model_comment... nothing
> happens and none of the rows are marked as deleted

This is not a bug. In case of the Blog Example it seems to be obvious 
that after deleting a blog its comments and posts can also be deleted. 
But the framework has no clue about the semantics of the domain (by now 
;-)).

Let's have a companies "Department" with a property "employees" holding 
instances of an "Employee". If you delete the "Department" (or better 
"liquidate" it). What should we do with the "Employees" (ok, don't start 
the philosophical/social discussion, please ;-)). I think it's better to 
assign them to the property "freelancers" of the "Company" object ;-).

In short: there is no general rule for deleting associated instances 
other than deleting ValueObjects is always safe.

But, to be honest, we still have a problem with deletion. If you remove 
an associated instance (e.g. by saying $blog->removePost($post)) nothing 
happens.

See also http://forge.typo3.org/issues/show/3875

Regards
Jochen

-- 
Every nit picked is a bug fixed



More information about the TYPO3-project-typo3v4mvc mailing list