Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-2759

ArrayHydration: Only first entity in OneToMany association is hydrated

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.3, Git Master
    • Fix Version/s: 2.3.5, 2.5, 2.4.1
    • Component/s: ORM
    • Security Level: All
    • Labels:
    • Environment:
      Windows, PHP 5.4.17

      Description

      When calling `getArrayResult()` on a query, the result is not being hydrated correctly. Where there should be multiple entities appearing (for a OneToMany association), only the first entity appears in the array.

      git bisect suggests this was introduced in https://github.com/doctrine/doctrine2/commit/08e38858ed36b13b2655f2971308361714798596

      I've attached a test case with a simplified schema that fails on the above commit, but passes on the commit immediately previous.

      If you need any further info, please let me know.

      EDIT: PR for failing test case: https://github.com/doctrine/doctrine2/pull/827

        Activity

        Chris Collins created issue -
        Chris Collins made changes -
        Field Original Value New Value
        Description When calling `getArrayResult()` on a query, the result is not being hydrated correctly. Where there should be multiple entities appearing (for a OneToMany association), only the first entity appears in the array.

        git bisect suggests this was introduced in https://github.com/doctrine/doctrine2/commit/08e38858ed36b13b2655f2971308361714798596

        I've attached a test case with a simplified schema that fails on the above commit, but passes on the commit immediately previous.

        If you need any further info, please let me know.
        When calling `getArrayResult()` on a query, the result is not being hydrated correctly. Where there should be multiple entities appearing (for a OneToMany association), only the first entity appears in the array.

        git bisect suggests this was introduced in https://github.com/doctrine/doctrine2/commit/08e38858ed36b13b2655f2971308361714798596

        I've attached a test case with a simplified schema that fails on the above commit, but passes on the commit immediately previous.

        If you need any further info, please let me know.

        EDIT: PR for failing test case: https://github.com/doctrine/doctrine2/pull/827
        Hide
        Doctrine Bot added a comment -

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

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

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

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

        Fixed

        Show
        Benjamin Eberlei added a comment - Fixed
        Benjamin Eberlei made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 2.3.5 [ 10521 ]
        Fix Version/s 2.5 [ 10522 ]
        Fix Version/s 2.4.1 [ 10528 ]
        Resolution Fixed [ 1 ]
        Hide
        Chris Collins added a comment -

        Great, thanks for the quick fix

        Show
        Chris Collins added a comment - Great, thanks for the quick fix

        This list may be incomplete, as errors occurred whilst retrieving source from linked applications:

        • Request to http://www.doctrine-project.org/fisheye/ failed: Error in remote call to 'FishEye 0 (http://www.doctrine-project.org/fisheye/)' (http://www.doctrine-project.org/fisheye) [AbstractRestCommand{path='/rest-service-fe/search-v1/crossRepositoryQuery', params={query=DDC-2759, expand=changesets[0:20].revisions[0:29],reviews}, methodType=GET}] : Received status code 503 (Service Temporarily Unavailable)

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Chris Collins
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: