Skip to content

Loading…

DDC-1226: OneToOne Unidirectional entities not persisting #1834

Closed
doctrinebot opened this Issue · 6 comments

2 participants

@doctrinebot

Jira issue originally created by user garrett:

We have the following three entities:

User
Participant
Profile

... Users and Participants are two distinctly different things in our system and each has a Profile. Currently we use OneToOne unidirectional associations to "map" the User to it's Profile and a Participant to it's Profile. So far (2.0) we've been able to do the following:

$profile = $user->getProfile();
$profile->setLastName('Doe');
$em->persist($profile);
$em->flush();

...and the profile is saved. In 2.1 rc1 this no longer works.

After some testing it was determined that 2.1 is requiring that our Profile refer back to each object (bidirectional). Now, this may not be the best example but imagine we had another entity that wanted to make use of a Profile, we'd rather not have to explicitly add the reference back for each entity that wants to use it just to get it persisted.

Again, in 2.0 our setup worked fine and so far I've been unable to find any documentation pointing to this sort of thing.

@doctrinebot

Comment created by @beberlei:

Is this relation marked as FETCH=EAGER? Can you post the mapping files of User and Profile please?

@doctrinebot

Comment created by @beberlei:

I could reproduce this issue now.

@doctrinebot

Comment created by @beberlei:

Fixed

@doctrinebot

Issue was closed with resolution "Fixed"

@doctrinebot

Comment created by erikhauters:

how do you mean? Fixed? Where can I find this fix?

@beberlei beberlei was assigned by doctrinebot
@doctrinebot doctrinebot added this to the 2.1 milestone
@doctrinebot doctrinebot closed this
@doctrinebot doctrinebot added the Bug label
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.