From b9abba43a229fffe1e86f978a4dd6b41a3b081a2 Mon Sep 17 00:00:00 2001 From: Fran Moreno Date: Tue, 7 Jun 2022 12:26:45 +0200 Subject: [PATCH] Fix ChoiceFilter operator type --- src/Filter/ChoiceFilter.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Filter/ChoiceFilter.php b/src/Filter/ChoiceFilter.php index de1f3a84..941e8f99 100644 --- a/src/Filter/ChoiceFilter.php +++ b/src/Filter/ChoiceFilter.php @@ -14,22 +14,26 @@ namespace Sonata\DoctrineMongoDBAdminBundle\Filter; use Sonata\AdminBundle\Filter\Model\FilterData; -use Sonata\AdminBundle\Form\Type\Filter\ChoiceType; use Sonata\AdminBundle\Form\Type\Filter\DefaultType; use Sonata\AdminBundle\Form\Type\Operator\ContainsOperatorType; +use Sonata\AdminBundle\Form\Type\Operator\EqualOperatorType; use Sonata\DoctrineMongoDBAdminBundle\Datagrid\ProxyQueryInterface; final class ChoiceFilter extends Filter { public function getDefaultOptions(): array { - return []; + return [ + 'operator_type' => EqualOperatorType::class, + 'operator_options' => [], + ]; } public function getRenderSettings(): array { return [DefaultType::class, [ - 'operator_type' => ChoiceType::class, + 'operator_type' => $this->getOption('operator_type'), + 'operator_options' => $this->getOption('operator_options'), 'field_type' => $this->getFieldType(), 'field_options' => $this->getFieldOptions(), 'label' => $this->getLabel(),