-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
[GridBundle] Allow filtering by fields from associated objects #5501
Conversation
$this->queryBuilder->andWhere($this->getFieldName($field).' =< :'.$field)->setParameter($field, $value); | ||
$this->setParameter($field, $value); | ||
|
||
$this->queryBuilder->andWhere($this->getFieldName($field).' =< :'.$field); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be <=
@pjedrzejewski why this PR not merge? What do you think? |
@@ -74,7 +74,7 @@ public function comparison($field, $operator, $value) | |||
*/ | |||
public function equals($field, $value) | |||
{ | |||
$this->queryBuilder->setParameter($field, $value); | |||
$this->setParameter($field, $value); | |||
|
|||
return $this->queryBuilder->expr()->eq($this->getFieldName($field), ':'.$field); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BUG: $field
(':'.$field
) still not replaced by _
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OOPS!! MY BAD!!
Build is failing, otherwise looks good! 👍 |
@pjedrzejewski The fail is about The problem is I do not want to apply any filter when form input of filter is not filled by user (e.g. filling only another field) because it will automatically only show data with empty strings! But on the other hand what to do if user really wants to filter empty strings? Should I not support filtering for empty strings? Or to add another field (checkbox) as |
The problems is that string filter type: empty / non-empty has no value - so your |
@pjedrzejewski Thanks for the feedback :) I think it's ready now |
Thanks Aram! Tests FTW! |
I also had some issues when filter form was submitting with empty string value so I thought maybe do not restrict DataSource when filer data is empty?!