Uploaded image for project: '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
    • Status: Closed
    • Priority: 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
        romanb 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
        romanb 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
        ss10sb 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
        ss10sb 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
        romanb Roman S. Borschel added a comment -

        Should be fixed now.

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

          People

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

            Dates

            • Created:
              Updated:
              Resolved: