Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-2246

ORM\UnitOfWork::getEntityState() crash when using a new Entity with association composite key

    Details

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

      Description

      I already found a similar issue report but it seems to be not solved completely:

      http://doctrine-project.org/jira/browse/DDC-1382

      I did something like this (mock): (Metadata cache is OFF)
      $someCompositeEntity = new SomeCompositeEntity;
      $someCompositeEntity->setUser($userEntity);
      $someCompositeEntity->setAnotherRelation($anotherRelationEntity);

      // Note: $userEntity & $anotherRelationEntity are managed by UOW.

      $uow = $em->getUnitOfWork();
      var_dump($uow->getEntityState($someCompositeEntity));

      – EXPECTED: –
      bool(false)

      – ACTUAL RESULT: –
      <h1>PHP Error [4096]</h1>
      <p>Object of class Application\Model\Db\Entity\User could not be converted to string (/Users/keksnicoh/lokalhorst/FinQ/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php:2754)</p>
      <pre>#0 unknown(0): CWebApplication->handleError()
      #1 /Users/keksnicoh/lokalhorst/FinQ/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php(2754): implode()
      #2 /Users/keksnicoh/lokalhorst/FinQ/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php(1389): Doctrine\ORM\UnitOfWork->tryGetById()
      #3 /Users/keksnicoh/lokalhorst/FinQ/Application/Model/Db/Model/AnswerCommentRating.php(42): Doctrine\ORM\UnitOfWork->getEntityState()

      As you see the metadatainfo tries to convert the composite objects to strings, instead of getting the identifiers from the objects.

      greetz
      keksnicoh

        Activity

        keks nicoh created issue -
        Benjamin Eberlei made changes -
        Field Original Value New Value
        Status Open [ 1 ] In Progress [ 3 ]
        Hide
        Benjamin Eberlei added a comment -

        Fixed and merged into 2.3.x branch

        Show
        Benjamin Eberlei added a comment - Fixed and merged into 2.3.x branch
        Benjamin Eberlei made changes -
        Status In Progress [ 3 ] Resolved [ 5 ]
        Fix Version/s 2.3.3 [ 10329 ]
        Resolution Fixed [ 1 ]

        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-2246, expand=changesets[0:20].revisions[0:29],reviews}, methodType=GET}] : Received status code 503 (Service Temporarily Unavailable)

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            keks nicoh
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: