Skip to content

Loading…

DDC-2478: PersisterException when matching Criteria expression isNull to ArrayCollection #3196

Closed
doctrinebot opened this Issue · 2 comments

1 participant

@doctrinebot

Jira issue originally created by user twistedlogic:

    /****
     * @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?

@doctrinebot

Comment created by @FabioBatSilva:

Fixed : f2f1d89

@doctrinebot

Issue was closed with resolution "Fixed"

@doctrinebot doctrinebot added this to the 2.4 milestone
@doctrinebot doctrinebot closed this
@doctrinebot doctrinebot added the Bug label
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.