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

Closed
opened 2026-01-22 12:50:58 +01:00 by admin · 4 comments
Owner

Originally created by @doctrinebot on GitHub (Jun 22, 2010).

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

?

Originally created by @doctrinebot on GitHub (Jun 22, 2010). 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]; ``` ?
admin added the Bug label 2026-01-22 12:50:58 +01:00
admin closed this issue 2026-01-22 12:50:58 +01:00
Author
Owner

@doctrinebot commented on GitHub (Jun 23, 2010):

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 commented on GitHub (Jun 23, 2010): Comment created by romanb: Not really, join columns have no field name but you may have encountered one of [DDC-522](http://www.doctrine-project.org/jira/browse/DDC-522) [DDC-383](http://www.doctrine-project.org/jira/browse/DDC-383) Join columns should really never be mapped to fields, they have no place whatsoever in the objects.
Author
Owner

@doctrinebot commented on GitHub (Jun 23, 2010):

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 commented on GitHub (Jun 23, 2010): Comment created by ss10sb: It looks like it is [DDC-383](http://www.doctrine-project.org/jira/browse/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.
Author
Owner

@doctrinebot commented on GitHub (Aug 8, 2010):

Comment created by romanb:

Should be fixed now.

@doctrinebot commented on GitHub (Aug 8, 2010): Comment created by romanb: Should be fixed now.
Author
Owner

@doctrinebot commented on GitHub (Aug 8, 2010):

Issue was closed with resolution "Fixed"

@doctrinebot commented on GitHub (Aug 8, 2010): Issue was closed with resolution "Fixed"
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#803