[PR #10587] Handle null comparisons in ManyToManyPersister #12474

Open
opened 2026-01-22 16:14:09 +01:00 by admin · 0 comments
Owner

Original Pull Request: https://github.com/doctrine/orm/pull/10587

State: closed
Merged: Yes


Fixes #5587, #5827 and #7717

The reason for a50a611bee/lib/Doctrine/ORM/Persisters/SqlValueVisitor.php (L34-L38) was that BasicEntityPersister replaces null comparisons with IS [NOT] NULL so it does not need the corresponding parameter.

Problem is, ManyToManyPersister has then no longer access to the comparison.

My fix is to remove the condition in SqlValueVisitor and make each persister wary of null comparisons. It feels super weird but tests pass.

**Original Pull Request:** https://github.com/doctrine/orm/pull/10587 **State:** closed **Merged:** Yes --- Fixes #5587, #5827 and #7717 The reason for https://github.com/doctrine/orm/blob/a50a611bee96f5c23c6e8bc0b46c8baba599d328/lib/Doctrine/ORM/Persisters/SqlValueVisitor.php#L34-L38 was that [`BasicEntityPersister` replaces null comparisons with `IS [NOT] NULL`](https://github.com/doctrine/orm/blob/a50a611bee96f5c23c6e8bc0b46c8baba599d328/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php#L1650-L1655) so it does not need the corresponding parameter. Problem is, `ManyToManyPersister` has then no longer access to the comparison. My fix is to remove the condition in `SqlValueVisitor` and make each persister wary of null comparisons. It feels super weird but tests pass.
admin added the pull-request label 2026-01-22 16:14:09 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#12474