Using ArrayCollection->clear over an entity marked to be persisted, doesn't create corresponding DELETE statements #6326

Closed
opened 2026-01-22 15:31:02 +01:00 by admin · 4 comments
Owner

Originally created by @ferrastas on GitHub (Oct 9, 2019).

Originally assigned to: @ostrolucky on GitHub.

Bug Report

Q A
BC Break yes/no
Version 2.6.4

Summary

Since 2.6.4 using clear over a collection using DEFERRED_EXPLICIT will not create the corresponding DELETE statements even when persisting the entity.
Introduced in https://github.com/doctrine/orm/issues/7758

Current behavior

Using clear over a collection using DEFERRED_EXPLICIT will not create the corresponding DELETE statements even when persisting the entity.

How to reproduce

A failing test available in https://github.com/doctrine/orm/pull/7861

Expected behavior

Collection items should be removed for entities marked to be persisted.

Originally created by @ferrastas on GitHub (Oct 9, 2019). Originally assigned to: @ostrolucky on GitHub. ### Bug Report <!-- Fill in the relevant information below to help triage your issue. --> | Q | A |------------ | ------ | BC Break | yes/no | Version | 2.6.4 #### Summary Since 2.6.4 using `clear` over a collection using `DEFERRED_EXPLICIT` will not create the corresponding `DELETE` statements even when persisting the entity. Introduced in https://github.com/doctrine/orm/issues/7758 #### Current behavior Using `clear` over a collection using `DEFERRED_EXPLICIT` will not create the corresponding `DELETE` statements even when persisting the entity. #### How to reproduce A failing test available in https://github.com/doctrine/orm/pull/7861 #### Expected behavior Collection items should be removed for entities marked to be persisted.
admin added the BugRegression labels 2026-01-22 15:31:02 +01:00
admin closed this issue 2026-01-22 15:31:02 +01:00
Author
Owner

@SenseException commented on GitHub (Oct 14, 2019):

Thank you for providing the failing test case 👍

@SenseException commented on GitHub (Oct 14, 2019): Thank you for providing the failing test case :+1:
Author
Owner

@lcobucci commented on GitHub (Nov 15, 2019):

Handled by https://github.com/doctrine/orm/pull/7861

@lcobucci commented on GitHub (Nov 15, 2019): Handled by https://github.com/doctrine/orm/pull/7861
Author
Owner

@paxal commented on GitHub (Nov 19, 2019):

Yes I'm the one to blame and I feed very sorry 🤦‍♂️
Hopefully everything is fine now 😅
Thanks !

@paxal commented on GitHub (Nov 19, 2019): Yes I'm the one to blame and I feed very sorry :man_facepalming: Hopefully everything is fine now :sweat_smile: Thanks !
Author
Owner

@Ocramius commented on GitHub (Nov 19, 2019):

@paxal take it easy: regressions are normal, we all do our best to avoid them, but can't have everything in mind.

@Ocramius commented on GitHub (Nov 19, 2019): @paxal take it easy: regressions are normal, we all do our best to avoid them, but can't have everything in mind.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#6326