Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-2478

PersisterException when matching Criteria expression isNull to ArrayCollection

    Details

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

      Description

          /**
           * @ORM\ManyToOne(targetEntity="ClubBoardPost", inversedBy="children")
           * @var ClubBoardPost
           */
          protected $parent;
      
      $criteria = Criteria::create()->where(Criteria::expr()->isNull('parent'));
      $this->boardPosts->matching($criteria);
      

      [output]
      Cannot match on Fubles\CoreBundle\Entity\ClubBoardPost::parent with a non-object value. Matching objects by id is not compatible with matching on an in-memory collection, which compares objects by reference.

      [first analysis]
      @SqlExpressionVisitor:69 It seems like this check pretends that the value must be an object, maybe do you need to exclude NULL values only if association is nullable?

        Activity

        Show
        Fabio B. Silva added a comment - Fixed : https://github.com/doctrine/doctrine2/commit/f2f1d8986c288a437b81cd756d889aa47880d8b8

          People

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

            Dates

            • Created:
              Updated:
              Resolved: