-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Global search ads wrong condition to custom query #3368
Global search ads wrong condition to custom query #3368
Comments
I also recognized that the link to the list views of the result is no passing the original filter. |
👍 |
1 similar comment
👍 |
Please stop 👍 on comments. Use emoji reactions for that. |
The only piece where |
Oh sorry, you're on the search page, right? I thought you had problems with the search handler interfering where it shouldn't. What you expect to happen is the following, right? WHERE existing_condition |
As written in the duplicated #4074 , the expected behaviour is |
Step 1 would be to pinpoint the piece of code where this happens, can you help with that @gprioux ? |
The following seems to be a workaround for this problem:
It seems the simplest way to fix the problem, not sure if it is a particularly good one. Might be better to rewrite the |
I think it could work, and I would approve a PR proposing that. The second solution sound better, but would indeed be more work, and might not be as backwards-compatible. |
@greg0ire I can make PR with this changes, and may be some code refactoring |
Please do :) |
Hi, Thanks |
We started a reflexion to fix the bug here #5589 |
Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward? This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
I'm not doing PHP/Symfony/Sonata Admin anymore so don't know if this still an issue for anyone. Feel free to close. |
I explained to @core23 on Twitter that I no longer maintain the projects that use Sonata. There have been some proposals for this issue. From my POV it can be closed. |
The bug is not solved. And it's not easy to fix. |
Unfortunately I can confirm that this is still a problem on latest version. |
Yes, the issue seems really hard to fix and nobody made a PR to fix this ATM. |
Instead of modifying the dataGrid, I modified the searchHandler to make this work. I have reused the code suggested above here. This solved my issue and might help someone who's looking to fix it. I override this SearchHandler service using a
|
This unfortunaly works only when you use the SonataDoctrineOrmBundle. But the methods you're calling are not available in the ProxyQueryInterface, so that does not allow to make a general fix. |
My
CompanyAdmin
uses thecreateQuery
method:The
where
condition is not added with anAND
operator but anOR
:This only happens when using the
createQuery
method and seems to be a problem of the global search adding it.Without that method it is generated correctly:
The text was updated successfully, but these errors were encountered: