[PR #6037] Added test for filtered eager joins #9826

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

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

State: closed
Merged: No


An SQLFilter is not called on collections with eager loading enabled. This PR contains a unit-test that shows the problem.

If I have

  • an order
  • with a product
  • and the product has a list of features
  • where the feature collection has fetch="EAGER" enabled
  • and only visible feature should be shown (enforced by an enabled SQLFilter).

then invisible features are still retrieved from the database!

This PR only contains a unit-test that shows the problem. The test passes if fetch="EAGER" is removed.

**Original Pull Request:** https://github.com/doctrine/orm/pull/6037 **State:** closed **Merged:** No --- An `SQLFilter` is not called on collections with eager loading enabled. This PR contains a unit-test that shows the problem. If I have - an order - with a product - and the product has a list of features - where the feature collection has `fetch="EAGER"` enabled - and only visible feature should be shown (enforced by an enabled `SQLFilter`). then invisible features are still retrieved from the database! This PR only contains a unit-test that shows the problem. The test passes if `fetch="EAGER"` is removed.
admin added the pull-request label 2026-01-22 16:05:32 +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#9826