-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fetch mode hint is ignored when using Paginator
#11741
Comments
aprat84
added a commit
to aprat84/orm
that referenced
this issue
Nov 28, 2024
Paginator
Paginator
I looked into it a little bit, and I think the problem is that in
Don't know if parameters also need to be cloned, as it is done in orm/src/Tools/Pagination/Paginator.php Line 183 in 73e68f3
|
aprat84
added a commit
to aprat84/orm
that referenced
this issue
Feb 5, 2025
…ctor This fixes a bug that arises when using Pagination and an entity relation is mapped with fetch-mode EAGER but setFetchMode LAZY (or anything that is not EAGER) has been used on the query. If the query use WITH condition, an exception is incorrectly raised (Associations with fetch-mode=EAGER may not be using WITH conditions). The class LimitSubqueryOutputWalker clones the query, but not its parameters and hints, so the generated subquery does not know that fetch-mode has been overridden. Fixes doctrine#11741
aprat84
added a commit
to aprat84/orm
that referenced
this issue
Feb 5, 2025
…ctor This fixes a bug that arises when using Pagination and an entity relation is mapped with fetch-mode EAGER but setFetchMode LAZY (or anything that is not EAGER) has been used on the query. If the query use WITH condition, an exception is incorrectly raised (Associations with fetch-mode=EAGER may not be using WITH conditions). The class LimitSubqueryOutputWalker clones the query, but not its parameters and hints, so the generated subquery does not know that fetch-mode has been overridden. Fixes doctrine#11741
aprat84
added a commit
to aprat84/orm
that referenced
this issue
Feb 6, 2025
…ctor This fixes a bug that arises when using Pagination and an entity relation is mapped with fetch-mode EAGER but setFetchMode LAZY (or anything that is not EAGER) has been used on the query. If the query use WITH condition, an exception is incorrectly raised (Associations with fetch-mode=EAGER may not be using WITH conditions). The class LimitSubqueryOutputWalker clones the query, but not its parameters and hints, so the generated subquery does not know that fetch-mode has been overridden. Fixes doctrine#11741
aprat84
added a commit
to aprat84/orm
that referenced
this issue
Feb 6, 2025
…ctor This fixes a bug that arises when using Pagination and an entity relation is mapped with fetch-mode EAGER but setFetchMode LAZY (or anything that is not EAGER) has been used on the query. If the query use WITH condition, an exception is incorrectly raised (Associations with fetch-mode=EAGER may not be using WITH conditions). The class LimitSubqueryOutputWalker clones the query, but not its parameters and hints, so the generated subquery does not know that fetch-mode has been overridden. Fixes doctrine#11741
aprat84
added a commit
to aprat84/orm
that referenced
this issue
Feb 7, 2025
…ctor This fixes a bug that arises when using Pagination and an entity relation is mapped with fetch-mode EAGER but setFetchMode LAZY (or anything that is not EAGER) has been used on the query. If the query use WITH condition, an exception is incorrectly raised (Associations with fetch-mode=EAGER may not be using WITH conditions). The class LimitSubqueryOutputWalker clones the query, but not its parameters and hints, so the generated subquery does not know that fetch-mode has been overridden. Fixes doctrine#11741
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bug Report
Summary
This is related to issue #11128 and PR #11445.
When a
fetch=EAGER
association is filtered usingWITH
, it raises an error unless fetch mode is overridden by callingsetFetchMode(LAZY)
over the association.This worked well after the fix in #11445.
Somehow, in 2.20.x and 3.3.x this bug returned, partially, only when using
Paginator
withfetchJoinCollection
parameter set totrue
.Seems like #11188 introduced this bug.
Current behavior
An exception is raised even when fetch mode is overridden.
Expected behavior
It should work the same with or without pagination.
How to reproduce
See test in https://github.com/aprat84/orm/tree/gh-11741
The text was updated successfully, but these errors were encountered: