DDC-1607: Entity with eager loaded association is not found when association is null #2017

Closed
opened 2026-01-22 13:37:40 +01:00 by admin · 10 comments
Owner

Originally created by @doctrinebot on GitHub (Jan 17, 2012).

Originally assigned to: @beberlei on GitHub.

Jira issue originally created by user mkoonstra:

Two entities: A and B

A:
id PRIMARY
b NULLABLE

B:
id PRIMARY

Situation: A.b is null and set to eager loading (with fetch="EAGER"), find(id) is called for object A

Actual Behaviour: The record from A is not found (probably due to an INNER JOIN being used).

Expected behaviour: Entity A is loaded with b set to null (like during lazy loading).

Originally created by @doctrinebot on GitHub (Jan 17, 2012). Originally assigned to: @beberlei on GitHub. Jira issue originally created by user mkoonstra: Two entities: A and B A: id PRIMARY b NULLABLE B: id PRIMARY Situation: A.b is null and set to eager loading (with fetch="EAGER"), find(id) is called for object A Actual Behaviour: The record from A is not found (probably due to an INNER JOIN being used). Expected behaviour: Entity A is loaded with b set to null (like during lazy loading).
admin added the Bug label 2026-01-22 13:37:40 +01:00
admin closed this issue 2026-01-22 13:37:41 +01:00
Author
Owner

@doctrinebot commented on GitHub (Jan 18, 2012):

Comment created by @guilhermeblanco:

Increasing priority

@doctrinebot commented on GitHub (Jan 18, 2012): Comment created by @guilhermeblanco: Increasing priority
Author
Owner

@doctrinebot commented on GitHub (Jan 18, 2012):

Comment created by @guilhermeblanco:

It seems to be associated with this commit:

68663fac4b (comments)

@doctrinebot commented on GitHub (Jan 18, 2012): Comment created by @guilhermeblanco: It seems to be associated with this commit: https://github.com/doctrine/doctrine2/commit/68663fac4b5619643b8a140d6bbe7031e4fa2ad5#comments
Author
Owner

@doctrinebot commented on GitHub (Jan 18, 2012):

Comment created by @guilhermeblanco:

Since it's a crash between versions, I'm increasing priority and also marking as regression.

@doctrinebot commented on GitHub (Jan 18, 2012): Comment created by @guilhermeblanco: Since it's a crash between versions, I'm increasing priority and also marking as regression.
Author
Owner

@doctrinebot commented on GitHub (Jan 18, 2012):

Comment created by @beberlei:

A blocker indeed, reschedulding RC1 release until this is fixed.

@doctrinebot commented on GitHub (Jan 18, 2012): Comment created by @beberlei: A blocker indeed, reschedulding RC1 release until this is fixed.
Author
Owner

@doctrinebot commented on GitHub (Jan 18, 2012):

Comment created by @beberlei:

Can you show us the mappings, specifically how you map A#b? Are you setting nullable=false on the join columns?

You problem could be related to:

https://github.com/doctrine/doctrine2/pull/180
https://github.com/doctrine/doctrine2/pull/182/files

@doctrinebot commented on GitHub (Jan 18, 2012): Comment created by @beberlei: Can you show us the mappings, specifically how you map A#b? Are you setting nullable=false on the join columns? You problem could be related to: https://github.com/doctrine/doctrine2/pull/180 https://github.com/doctrine/doctrine2/pull/182/files
Author
Owner

@doctrinebot commented on GitHub (Jan 19, 2012):

Comment created by @guilhermeblanco:

Hi,

I was unable to reproduce your issue with the comments you made so far.
Are you able to modify the attached test file into a failure state that represents your problem?

It may be easier for us to track down your problem after that.

@doctrinebot commented on GitHub (Jan 19, 2012): Comment created by @guilhermeblanco: Hi, I was unable to reproduce your issue with the comments you made so far. Are you able to modify the attached test file into a failure state that represents your problem? It may be easier for us to track down your problem after that.
Author
Owner

@doctrinebot commented on GitHub (Jan 19, 2012):

Comment created by mkoonstra:

Trying the test case on master, but can't seem to be able to reproduce the bug (same goes for the actual problem case)

Maybe some code has changed allready? I will investigate further if I can reproduce the bug in master.

@doctrinebot commented on GitHub (Jan 19, 2012): Comment created by mkoonstra: Trying the test case on master, but can't seem to be able to reproduce the bug (same goes for the actual problem case) Maybe some code has changed allready? I will investigate further if I can reproduce the bug in master.
Author
Owner

@doctrinebot commented on GitHub (Jan 21, 2012):

Comment created by @beberlei:

Closing as invalid, please reopen if you can reproduce, but it seems this is fixed.

@doctrinebot commented on GitHub (Jan 21, 2012): Comment created by @beberlei: Closing as invalid, please reopen if you can reproduce, but it seems this is fixed.
Author
Owner

@doctrinebot commented on GitHub (Jan 21, 2012):

Issue was closed with resolution "Invalid"

@doctrinebot commented on GitHub (Jan 21, 2012): Issue was closed with resolution "Invalid"
Author
Owner

@doctrinebot commented on GitHub (Dec 13, 2015):

Imported 1 attachments from Jira into https://gist.github.com/663fcfa957f0b78e0750

@doctrinebot commented on GitHub (Dec 13, 2015): Imported 1 attachments from Jira into https://gist.github.com/663fcfa957f0b78e0750 - [11153_DDC1607Test.php](https://gist.github.com/663fcfa957f0b78e0750#file-11153_DDC1607Test-php)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#2017