mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
OneToOne cascade persist throws exception #5590
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 @boesing on GitHub (Jun 26, 2017).
Originally assigned to: @Ocramius on GitHub.
Hey there,
I have two relating entities:
If I want to persist A like this, I get the exception, that there is no identifier value set yet (ofc not, I am actually persisting tho...):
The Problem is, that the Method
\Doctrine\ORM\UnitOfWork::scheduleForInsertwants to create an identifier hash but since we did not flushed the entities yet, there aint any value other than null.@Ocramius commented on GitHub (Jun 26, 2017):
Is it really the first statement throwing an exception here?
Can we eventually have a test case?
@lcobucci commented on GitHub (Jun 26, 2017):
@boesing @Ocramius this is definitely related to the refactoring of the commit order calculation that was done a couple years ago and which is just part of
2.6.x. Since the changes are quite complex to backport we decided to keep that only onmaster.@boesing as I said on your PR, try to reproduce this against
master. If you're unable, I do recommend you to start changing your application to be compatible with our next minor release.@boesing commented on GitHub (Jun 26, 2017):
@lcobucci The problem is, that we are not using PHP 7.1 yet... :/
@lcobucci commented on GitHub (Jun 26, 2017):
@boesing I understand but this seems to be one of the edge cases that we couldn't backport and unfortunately if you want to use that mapping you would have to update.
If you don't manage to reproduce this on
master, you could try to use a fixed commit on yourcomposer.jsonto "solve" this until you upgrade your stack to PHP 7.1.It's definitely not ideal but serves as a TEMPORARY workaround (at
fc67b398a1all the tests were working and PHP 7.0 was still supported). Please mind the emphasis on temporary 😂@Ocramius commented on GitHub (Jun 28, 2017):
I closed this as
incompleteon the PR, closing it here as well.@boesing all we need is to test it against
masteron the repository. Due to the patches that landed in2.6, we won't be able to fix this for2.5anymore, sorry.