-
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
Bring FilterCollection
to a "clean" state after hash computation
#9523
Conversation
Thank you. Can you please provide a test that reproduces the issue that your attempt to fix? |
I don't know what I am trying to fix here 🐼 . I came across this clean/dirty state distinction and figured it makes no sense the way it is implemented right now. This PR is my guess what the original author might have intended and I'd be glad if this gets a bit more scrutiny. |
ac68685
to
1305658
Compare
I've added a test. |
* 2.11.x: Bring `FilterCollection` to a "clean" state after hash computation (#9523)
Improvement
Effectively, the
FilterCollection
was never brought back into a "clean" state after filters were enabled or filter parameters were set.As far as I can tell, the clean/dirty distinction only refers to the computed FilterCollection hash reflecting all enabled filters and their parameters.
The only place I could find where the distinction matters is here:
orm/lib/Doctrine/ORM/Query.php
Lines 241 to 259 in 152c04c
When the filter collection is dirty and the query cache is used, the call to
getQueryCacheId()
in the last line shown will reset the filter collection to aclean
state.When there is no query cache, however,
getQueryCacheId()
is not called and theFilterCollection
will not revert to a clean state; this prevents re-using the query later on.If desired, I could add a
FilterCollection::setFiltersStateClean()
method to improve this case as well.Closes #9521