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

Closed
opened 2026-01-22 14:12:30 +01:00 by admin · 2 comments
Owner

Originally created by @doctrinebot on GitHub (May 30, 2013).

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?

Originally created by @doctrinebot on GitHub (May 30, 2013). 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?
admin added the Bug label 2026-01-22 14:12:30 +01:00
admin closed this issue 2026-01-22 14:12:31 +01:00
Author
Owner

@doctrinebot commented on GitHub (Jun 14, 2013):

Comment created by @FabioBatSilva:

Fixed : f2f1d8986c

@doctrinebot commented on GitHub (Jun 14, 2013): Comment created by @FabioBatSilva: Fixed : https://github.com/doctrine/doctrine2/commit/f2f1d8986c288a437b81cd756d889aa47880d8b8
Author
Owner

@doctrinebot commented on GitHub (Jun 14, 2013):

Issue was closed with resolution "Fixed"

@doctrinebot commented on GitHub (Jun 14, 2013): Issue was closed with resolution "Fixed"
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#3109