-
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
Filter on JOIN #6343
Comments
From the docs:
So this would seem like a bug. Did you try running the query with XDebug? As for the PR you linked - do you have eager fetch as well? |
@szymach, we do have eager fetch configured for both entities that were involved. I did not run it with XDebug enabled, we just reversed the queried the related entity as it was more important than the one we were query-ing. |
I can confirm combining fetch="EAGER" and SQLFilter does not work well. SQLFilter is not aplied in this scenario. Fix would be nice:D |
@mssimi we're doing the best we can with the contributors that we have but since the failing test to reproduce it is available anyone could send a patch to fix the issue 😉 |
I confirm this on one-to-one bidirectional association. After owning side is soft deleted. When i get inversed side entity by simple select it also join owning side without filter applied.
This class has also SoftDeleteable extension applied from Atlantic18/DoctrineExtensions which adds SQL filters. And when i try to select single entity i get SQL:
You can see: |
@lukaszjakubek could you please send us a failing test case that reproduces that behaviour? It would help us a lot to identify and fix the issue you're describing. You can find examples on https://github.com/doctrine/doctrine2/tree/388afb46d0cb3ed0c51332e8df0de9e942c2690b/tests/Doctrine/Tests/ORM/Functional/Ticket |
Here is connected issue in Atlantic18/DoctrineExtensions with explanation and failing test case |
Any news from this? |
Are there any news on this issue? I'm facing exactly the same problem after upgrading from v2.4.8 to v2.5.14. Is this Bug fixed in newer versions or is it still remaining in the follow up versions of Doctrine? |
The same issue :( |
Same problem in 2021 :( |
We are also experiencing this issue and wish it could be resolved. |
This issue is labeled as missing-tests, but here is a relevant testcase: #6037 Edit: This PR is actually mentioned in OP. |
Same problem in 2023 :( |
Same problem here 🙁 |
Hi, I'm having a problem filtering entities when retrieved through a join.
This is my case (simplified):
Let's say I have a User entity, and a Car entity. Both entities are soft-deletable (whether they're a good pattern or bad, I use them). When I
find
a User, the filter is applied, as well as with the Car entity. However, when Ifind
a User and include the Car in a join, the filter is only applied to the User entity, and it returns the deleted Car entities as well.I could not find any documentation as to whether this is expected (and wanted) behaviour, or a "bug". Shouldn't the filters also be applied to fetched relations?
Can anyone elaborate?
Edit: upon better search, this might be related to #6037
The text was updated successfully, but these errors were encountered: