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

Closed
doctrinebot opened this Issue Jun 22, 2010 · 4 comments

1 participant

@doctrinebot

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];

?

@doctrinebot

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.

@doctrinebot

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.

@doctrinebot

Comment created by romanb:

Should be fixed now.

@doctrinebot

Issue was closed with resolution "Fixed"

@doctrinebot doctrinebot added this to the 2.0-BETA4 milestone Dec 6, 2015
@doctrinebot doctrinebot closed this Dec 6, 2015
@doctrinebot doctrinebot added the Bug label Dec 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment