Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.5, 2.4.2
    • Component/s: None
    • Security Level: All
    • Labels:
      None

      Description

      This issue is created automatically through a Github pull request on behalf of Ocramius:

      Url: https://github.com/doctrine/doctrine2/pull/917

      Message:

      This is a hotfix for DDC-2931 ( #916 )

      > After some debugging, I found that the issue came from `UnitOfWork#createEntity`(https://github.com/doctrine/doctrine2/blob/bba5ec27fbbe35224be48878a0c92827ef2f9733/lib/Doctrine/ORM/UnitOfWork.php#L2512-L2528) with #406 (DCOM-96(http://www.doctrine-project.org/jira/browse/DCOM-96)).

      > When initializing the proxy for `$first` (during the `DDC2931User#getRank()` call), the ORM attempts to fetch also `$second` again via `ObjectHydrator#getEntity`(https://github.com/doctrine/doctrine2/blob/bba5ec27fbbe35224be48878a0c92827ef2f9733/lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php#L280)`, but the hint `doctrine.refresh.entity` contains the initialized proxy, while the identifier passed down is the identifier of `$second` (not a proxy).

      > `UnitOfWork#createQuery` does some comparisons and detects the fact that the two objects don't correspond, and therefore marks the entity as "to be detached" (since it thinks that the one in the "refresh" hint is the correct entity to load).

        Issue Links

          Activity

          Hide
          Doctrine Bot added a comment -

          A related Github Pull-Request [GH-916] was closed:
          https://github.com/doctrine/doctrine2/pull/916

          Show
          Doctrine Bot added a comment - A related Github Pull-Request [GH-916] was closed: https://github.com/doctrine/doctrine2/pull/916
          Hide
          Doctrine Bot added a comment -

          A related Github Pull-Request [GH-917] was closed:
          https://github.com/doctrine/doctrine2/pull/917

          Show
          Doctrine Bot added a comment - A related Github Pull-Request [GH-917] was closed: https://github.com/doctrine/doctrine2/pull/917

            People

            • Assignee:
              Marco Pivetta
              Reporter:
              Doctrine Bot
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: