Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.3.4
    • Fix Version/s: 2.4, 2.3.5
    • Component/s: ORM
    • Security Level: All
    • Labels:
    • Environment:
      PHP 5.4.4, PostgreSQL 9.2

      Description

      I think, in BasicEntityPersister is bug in detecting types:
      https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php#L583

      The $types array is not defined inside closure function. This makes problem with deleting entity with two and more primary keys which one of them references to another entity with reference too.
      My relationship (example):
      User(id,name)
      Person(user_id,birthdate)
      Email(user_id, email) but FK (and @manyToOne relation) on user_id field references to Person table/entity, not User. FK in Person entity references to User of course.
      Trying delete the Email entity record throws exception based a few lines later.

        Activity

        Show
        Fabio B. Silva added a comment - Fixed : https://github.com/doctrine/doctrine2/commit/7055ccbf9bc9bd72b184734bcbeb72e682bf642b
        Hide
        Jan Pecek added a comment -

        I agree with fix. I've done the same at my local repo and it works well. Thanks for confirmation.

        Show
        Jan Pecek added a comment - I agree with fix. I've done the same at my local repo and it works well. Thanks for confirmation.

          People

          • Assignee:
            Fabio B. Silva
            Reporter:
            Jan Pecek
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: