Skip to content
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

Open
aprat84 opened this issue Nov 28, 2024 · 1 comment
Open

Fetch mode hint is ignored when using Paginator #11741

aprat84 opened this issue Nov 28, 2024 · 1 comment

Comments

@aprat84
Copy link
Contributor

aprat84 commented Nov 28, 2024

Bug Report

Q A
Version 2.20.0 / 3.3.0
Previous working version 2.19.8 / 3.2.3

Summary

This is related to issue #11128 and PR #11445.

When a fetch=EAGER association is filtered using WITH, it raises an error unless fetch mode is overridden by calling setFetchMode(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 with fetchJoinCollection parameter set to true.

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

vendor/bin/phpunit --filter testSubselectFetchJoinWithAllowedWhenOverriddenNotEagerPaginator

There was 1 error:

1) Doctrine\Tests\ORM\Functional\EagerFetchCollectionTest::testSubselectFetchJoinWithAllowedWhenOverriddenNotEagerPaginator
Doctrine\ORM\Query\QueryException: Associations with fetch-mode=EAGER may not be using WITH conditions in "Doctrine\Tests\ORM\Functional\EagerFetchChild#owner".
aprat84 added a commit to aprat84/orm that referenced this issue Nov 28, 2024
@aprat84
Copy link
Contributor Author

aprat84 commented Dec 9, 2024

Seems like #11188 introduced this bug. Commits were squashed apparently, so can't test them separately.

@mpdude @greg0ire

@aprat84 aprat84 changed the title Fetch mode hint is ignored in Paginator Fetch mode hint is ignored when using Paginator Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant