mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
ManyToOne not updating properly #5426
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 @juniwalk on GitHub (Feb 23, 2017).
Hello,
when I try to remove domain from the Project, it tries to update the
$domainscollection which is wrong, as it is not the owning side. This happens only when I try to load domains using post-fetching.This fails to do anything. I check the UnitOfWork and it is trying to update $domains collection instead of setting
domain.project_idtoNULL.This is not the case if I load $domains in separate query. Then the same removeDomain works as expected.
$this->domainRepository->createQueryBuilder('d', 'd.id')->setParameter('project', $project)->where('d.project = :project');Is this me doing something wrong? Or it that some sort of issue in doctrine?
@Ocramius commented on GitHub (Feb 23, 2017):
This is really weird. I don't understand the issue, can you please write a test case exposing the desired behavior?
@juniwalk commented on GitHub (Feb 23, 2017):
@Ocramius Yeah, I will try.
@juniwalk commented on GitHub (Feb 24, 2017):
@Ocramius So I was unable to replicate this in a test case
so I created simple sandbox.@Ocramius commented on GitHub (Mar 24, 2017):
Sorry, but this needs to be a unit test in the suite of this project: nobody is going to debug it inside a larger environment.
@juniwalk commented on GitHub (Apr 26, 2017):
@Ocramius Sorry for the delay, I found another angle on this so I will try to replicate those tests once more.
@juniwalk commented on GitHub (Apr 27, 2017):
So I tried again to replicate the issue in the tests to no avail. In the tests it just works as it is supposed to.
I opened up UnitOfWork.php to trace the problem and after few hours I traced the problem to line 2597. If I comment that continue out, it starts working as expected.
What shall I do when I am unable to replicate this in tests for you?
@Ocramius commented on GitHub (May 2, 2017):
@juniwalk without a test case reproducing this, no development can be done around it, sorry :-(
@juniwalk commented on GitHub (Feb 26, 2021):
Issue was on my side.