Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-2086

[GH-484] Prevented "Undefined index" notice when updating

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Trivial Trivial
    • Resolution: Fixed
    • Affects Version/s: 2.3, Git Master
    • Fix Version/s: 2.3.1
    • Component/s: ORM
    • Security Level: All
    • Labels:
    • Environment:
      OS X 10.8.2, PHP 5.3.17, Nginx 1.2.4 (php through FPM)

      Description

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

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

      Message:

      While executing updates on an entity scheduled for update without a change-set, an "Undefined index" notice is raised.

      This issue will occur when you manually call $em()->getUnitOfWork()->scheduleForUpdate() on an entity that hasn't changed. The entity will be included in UnitOfWork::$entityUpdates, but because there are no changes, its oid will not be included in UnitOfWork::$entityChangeSets.

      I know I'm misusing scheduleForUpdate() a bit in this case, but the notice can easily be prevented with a !empty().

        Activity

        Benjamin Eberlei created issue -
        Jasper N. Brouwer made changes -
        Field Original Value New Value
        Affects Version/s Git Master [ 10100 ]
        Affects Version/s 2.3 [ 10185 ]
        Environment OS X 10.8.2, PHP 5.3.17, Nginx 1.2.4 (php through FPM)
        Priority Major [ 3 ] Trivial [ 5 ]
        Labels unitofwork
        Component/s ORM [ 10012 ]
        Jasper N. Brouwer made changes -
        Description This issue is created automatically through a Github pull request on behalf of jappie:

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

        Message:

        While executing updates on an entity scheduled for update without a change-set, an "Undefined index" notice is raised.

        This issue will occur when you manually call `$em()->getUnitOfWork()->scheduleForUpdate()` on an entity that hasn't changed. The entity will be included in `UnitOfWork::$entityUpdates`, but because there are no changes, its oid will not be included in `UnitOfWork::$entityChangeSets`.

        I know I'm misusing `scheduleForUpdate()` a bit in this case, but the notice can easily be prevented with a `!empty()`.
        This issue is created automatically through a Github pull request on behalf of jappie:

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

        Message:

        While executing updates on an entity scheduled for update without a change-set, an "Undefined index" notice is raised.

        This issue will occur when you manually call {{$em()\->getUnitOfWork()\->scheduleForUpdate()}} on an entity that hasn't changed. The entity will be included in {{UnitOfWork::$entityUpdates}}, but because there are no changes, its oid will not be included in {{UnitOfWork::$entityChangeSets}}.

        I know I'm misusing {{scheduleForUpdate()}} a bit in this case, but the notice can easily be prevented with a {{!empty()}}.
        Hide
        Benjamin Eberlei added a comment -

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

        Show
        Benjamin Eberlei added a comment - A related Github Pull-Request [GH-484] was closed https://github.com/doctrine/doctrine2/pull/484
        Show
        Fabio B. Silva added a comment - Merged : https://github.com/doctrine/doctrine2/commit/cd7ef6e7a70d4ff4c25a85fdae71676aa6548ea6
        Fabio B. Silva made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Benjamin Eberlei made changes -
        Fix Version/s 2.3.1 [ 10323 ]
        Hide
        Doctrine Bot added a comment -

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

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

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

          People

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

            Dates

            • Created:
              Updated:
              Resolved: