Skip to content

Avoid duplicate processing of entities in certain situations#91

Merged
mpdude merged 2 commits intomasterfrom
avoid-duplicate-eject
Apr 10, 2026
Merged

Avoid duplicate processing of entities in certain situations#91
mpdude merged 2 commits intomasterfrom
avoid-duplicate-eject

Conversation

@mpdude
Copy link
Copy Markdown
Member

@mpdude mpdude commented Apr 10, 2026

In certain situations where Doctrine detectes new entities with cascade: persist during a flush operation, it might happen that the same entity ends up twice in the map of tracked entities, leading to duplicate PersistentTranslatable::eject() calls and failures (nothing left to eject after the first call).

This can be avoided by making sure we track each object (instance) only once.

@mpdude mpdude force-pushed the avoid-duplicate-eject branch from 81c9834 to ec4ec8f Compare April 10, 2026 14:58
@mpdude mpdude merged commit 5a8f4a6 into master Apr 10, 2026
@mpdude mpdude deleted the avoid-duplicate-eject branch April 10, 2026 14:59
mpdude added a commit that referenced this pull request Apr 10, 2026
mpdude added a commit that referenced this pull request Apr 10, 2026
#91 was too eager in skipping the injections of translatable proxies: We
only need to avoid duplicate entries in the list of entities with
translatables, but we must not skip injection of the proxies after
`flush()` operations.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant