Uploaded image for project: 'Doctrine 2 - ORM'
  1. Doctrine 2 - ORM
  2. DDC-1392

Merge for not initialized entity proxy object with set ID fails

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.1.1
    • Fix Version/s: 2.1.2
    • Component/s: ORM
    • Security Level: All
    • Labels:
      None

      Description

      Problem is that UnitOfWork::doMerge() calls ClassMetadata::getIdentifierValues() for the entity but that function doesn't have case for not initialized proxy. It just reads the Id properties from the object's reflection.

      It should load the proxy or get the ID stored inside the proxy object or doMerge must initialize it maybe.

        Issue Links

          Activity

          Hide
          gedrox Aigars Gedroics added a comment -

          I have taken the DDC353 test as the base for this test case.
          Hopefully it works because I have executed it in slightly different version without the Doctrine tests environment.

          Show
          gedrox Aigars Gedroics added a comment - I have taken the DDC353 test as the base for this test case. Hopefully it works because I have executed it in slightly different version without the Doctrine tests environment.
          Hide
          beberlei Benjamin Eberlei added a comment -

          Fixed

          Show
          beberlei Benjamin Eberlei added a comment - Fixed
          Hide
          gedrox Aigars Gedroics added a comment -

          I would put the changes inside the method getIdentifierValues not before it's execution.

          Isn't it plausible that it is called with not initialized proxy from somewhere else?

          Show
          gedrox Aigars Gedroics added a comment - I would put the changes inside the method getIdentifierValues not before it's execution. Isn't it plausible that it is called with not initialized proxy from somewhere else?

            People

            • Assignee:
              beberlei Benjamin Eberlei
              Reporter:
              gedrox Aigars Gedroics
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: