mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
Inheritance does not work properly after "Fix OneToManyPersister::deleteEntityCollection missing discriminator column/value." #7398
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @konrad-czernecki-esky on GitHub (Jul 15, 2024).
Bug Report
Summary
After this fix https://github.com/doctrine/orm/issues/11500, I have a problem with the SINGLE_TABLE inheritance type, because when I set a new collection (in order to replace the previous one) in my one-to-many relation, the data in the old collection is not deleted.
Current behavior
The collection that is being replaced has not been replaced (old data remains + new appears)
How to reproduce
*Pseudocode
Reproduction:
The reason is that the SQL query generated in
\Doctrine\ORM\Persisters\Collection\OneToManyPersister::deleteEntityCollectionhas a null value in the "type" column.DELETE FROM components WHERE page_id = eab311cf-9854-4872-a2c6-73376b7b9936 AND type = nullExpected behavior
Old collection should be deleted and only new data should remain. Before v2.19.6 everything works well.