Skip to content

Fix JoinedSubclassPersister when multiple entities are inserted #11934

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: 2.20.x
Choose a base branch
from

Conversation

mvorisek
Copy link
Contributor

@mvorisek mvorisek commented May 8, 2025

Same fix as in base/BasicEntityPersister class - https://github.com/doctrine/orm/blob/2.20.3/src/Persisters/Entity/BasicEntityPersister.php#L310. Missed in #10735.

I have extracted this from reworked #8260 which will target v3.x.

The fix can be verified by modifying UnitOfWork to execute BasicEntityPersister::executeInserts() for multiple entities at once for the same entity class/persister instance - https://github.com/doctrine/orm/blob/2.20.3/src/UnitOfWork.php#L1186 - then reproducible on Doctrine\Tests\ORM\Functional\Ticket\GH10531Test::testInserts test.

As extending/modifying UnitOfWork in tests in not easily possible, I submit this fix for v2.x without a test.

@mvorisek
Copy link
Contributor Author

@greg0ire can this PR be merged please?

Test for this cannot be easily added (it will be very long), I hope the description is enough. If you require better commit description please let me know and what exactly should I mention there. Thank you.

@greg0ire
Copy link
Member

Please include a description of the problem and a description of the fix in the commit message

Fix JoinedSubclassPersister as BasicEntityPersister was already fixed in doctrineGH-10735.

I have extracted this from reworked doctrineGH-8260 which will target v3.x.

The fix can be verified by modifying UnitOfWork to execute `BasicEntityPersister::executeInserts()` for multiple entities at once for the same entity class/persister instance - https://github.com/doctrine/orm/blob/2.20.3/src/UnitOfWork.php#L1186 - then reproducible on `Doctrine\Tests\ORM\Functional\Ticket\GH10531Test::testInserts` test.

As extending/modifying UnitOfWork in tests in not easily possible, I submit this fix for v2.x without a test.
@mvorisek mvorisek force-pushed the fix_joined_subclass_persister_insert_of_multiple_entities branch from 06e6d19 to c32852b Compare July 20, 2025 22:48
@mvorisek
Copy link
Contributor Author

I have adjusted the commit message.

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.

2 participants