Fix JoinedSubclassPersister when multiple entities are inserted#11934
Conversation
|
@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. |
|
Please include a description of the problem and a description of the fix in the commit message |
06e6d19 to
c32852b
Compare
|
I have adjusted the commit message. |
|
You've copied the PR description to the commit message.
does not describe the problem, and delegates the description of the fix to another page
A reference, again, but no description
Describes neither the problem nor the fix
Same |
|
In my fork I work on #8260. I have discovered this issue when working with the ˙JoinedSubclassPersister˙ with multiple entities at once. In #10735 the exact change was done for the basic So the exact same reasoning goes for this PR. Should I copy the same comment above the I hope this reasons the change enough. Let me know if I can/should do something more. |
|
@greg0ire the issue is described in https://github.com/doctrine/orm/blob/2.20.3/src/Persisters/Entity/BasicEntityPersister.php#L303-L309 . Should I copy the comment here too? Or add above the |
|
Yes, you should copy the comment above the |
Fix JoinedSubclassPersister as BasicEntityPersister was already fixed in doctrineGH-10735. 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.
c32852b to
97a7cb8
Compare
|
done and improved the base comment slightly |
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 onDoctrine\Tests\ORM\Functional\Ticket\GH10531Test::testInsertstest.As extending/modifying UnitOfWork in tests in not easily possible, I submit this fix for v2.x without a test.