mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
orphanRemoval not working for OneToMany collections when using a custom type for the identifier and oracle database
#6976
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 @lordrhodos on GitHub (May 9, 2022).
Bug Report
Summary
When using a custom type for the identifier of a
OneToManyrelation theorphanRemovalsetting will trigger an error.Current behavior
In my case I am using a
OneToManyrelation toSessionTag:Session
SessionTaguses a custom uuid type as id:SessionTag
When I add the
orphanRemoval=trueattribute to the annotation and remove entities from the collection, aflushwill trigger the following error:Root cause
The cause of the issue is the missing support for custom types in the method
\Doctrine\ORM\Persisters\Collection\OneToManyPersister::deleteEntityCollection. TheexecuteStatementis called without passing the types, triggering the error:4af1aa3177/lib/Doctrine/ORM/Persisters/Collection/OneToManyPersister.php (L169-L187)Expected behavior
The
orphanRemovalattribute should be supported for custom types.@derrabus commented on GitHub (May 11, 2022):
Thank you for your report. Are you able to work on a fix?
@lordrhodos commented on GitHub (May 12, 2022):
@derrabus the fix is ready, but I had no luck providing a failing test with sqlite so far. Will work on that 😉