Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-1399

Wrong count() value in many-to-many relationship and EXTRA_LAZY

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.1.1
    • Fix Version/s: 2.1.3
    • Component/s: None
    • Security Level: All
    • Labels:
      None
    • Environment:
      Symfony 2.0.3 / LAMP

      Description

      Relation many-to-many, EXTRA_LAZY, $user is owning side. Without EXTRA_LAZY all is ok.

      Main problem: counter is increased twice.

      $user->getPhotos()->count(); // returns 100 (OK)
      $user->addPhoto($photo);
      $user->getPhotos()->count(); // returns 101 (OK)
      $em->flush();
      $user->getPhotos()->count(); // returns 102 (WRONG! Should be 101)

        Activity

        Hide
        Benjamin Eberlei added a comment -

        verified.

        Show
        Benjamin Eberlei added a comment - verified.
        Hide
        Benjamin Eberlei added a comment -

        fixed

        Show
        Benjamin Eberlei added a comment - fixed

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Paweł Gniadkowski
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: