Skip to content


DDC-650: $data using wrong index in UnitOfWork::createEntity() in one to one assoc #5159

doctrinebot opened this Issue · 4 comments

1 participant


Jira issue originally created by user ss10sb:

It looks like $data is using the wrong index ($srcColumn) in UnitOfWork::createEntity() line 1834 (1854 in github repo, it seems my IDE can't count ;)) to get the $joinColumnValue. Since $data contains the camelized field names and $srcColumn is the actual field name, should it be:

+ $joinColumnValue = $data[$class->fieldNames[$srcColumn]];
- $joinColumnValue = $data[$srcColumn];



Comment created by romanb:

Not really, join columns have no field name but you may have encountered one of DDC-522 DDC-383

Join columns should really never be mapped to fields, they have no place whatsoever in the objects.


Comment created by ss10sb:

It looks like it is DDC-383 for me. I think this occurred in my case because the tables use compound keys and I was using partials and part of the compound key was also the foreign key for a joined table. Since the partial required all the compound keys be added to the field list, the foreign key was also added and probably caused this.

Thanks for the explanation.


Comment created by romanb:

Should be fixed now.


Issue was closed with resolution "Fixed"

@doctrinebot doctrinebot added this to the 2.0-BETA4 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.