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

TranslationFieldFilter does not respect setCondition #240

Closed
andrewtch opened this issue Sep 26, 2018 · 0 comments · Fixed by #241
Closed

TranslationFieldFilter does not respect setCondition #240

andrewtch opened this issue Sep 26, 2018 · 0 comments · Fixed by #241

Comments

@andrewtch
Copy link
Contributor

andrewtch commented Sep 26, 2018

Subject

When using GlobalSearch, filters are built with OR condition:

if ($filter->getOption('global_search', false)) {
    $filter->setCondition(FilterInterface::CONDITION_OR);
    $datagrid->setValue($filter->getFormName(), null, $term);
    $found = true;
 }

however, TranslationFieldFilter applies andWhere explicitly: https://github.com/sonata-project/SonataTranslationBundle/blob/2.x/src/Filter/TranslationFieldFilter.php#L56

It should respect $condition and act accordingly. Should I PR that?

greg0ire pushed a commit that referenced this issue Sep 28, 2018
Make TranslationFieldFilter respect condition, fixes global search on translatable fields. Fixes #240
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

Successfully merging a pull request may close this issue.

1 participant