Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-650

$data using wrong index in UnitOfWork::createEntity() in one to one assoc

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-BETA2
    • Fix Version/s: 2.0-BETA4
    • Component/s: ORM
    • Security Level: All
    • Labels:
      None

      Description

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

      ?

        Activity

        Hide
        Roman S. Borschel added a comment -

        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.

        Show
        Roman S. Borschel added a comment - 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.
        Hide
        Scott Morken added a comment -

        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.

        Show
        Scott Morken added a comment - 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.
        Hide
        Roman S. Borschel added a comment -

        Should be fixed now.

        Show
        Roman S. Borschel added a comment - Should be fixed now.

          People

          • Assignee:
            Roman S. Borschel
            Reporter:
            Scott Morken
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: