-
Notifications
You must be signed in to change notification settings - Fork 121
Filtering against multiple choices/entities doesn't work #48
Comments
Hi, for the |
@cedric-g : it doesn't seems to work with filter_entity :
Form code: public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder->add('property', 'filter_entity', array(
'class' => 'MyBundle:MyEntity',
'expanded' => TRUE,
'multiple' => TRUE,
));
} |
That is what Cedric said with its previous comment. You can make use of the 'apply_filter' option, look at the link for an example. You should iterate over the results, in order to add it to the |
@gaetan-petit do you use a |
@cedric-g Thanks for the answer but something is still wrong. When multiple option are selected the query is not correct, and returns no results: AND t1_.status_id IN ('43,44,45') Instead of: AND t1_.status_id IN (43,44,45) I'am trying to spot where is the faulty code, but I bet you will be faster than me 😉 |
@gaetan-petit Which version of the bundle are you using ? |
@cedric-g : I'm on master with in my config.yml lexik_form_filter:
where_method: and |
I pushed a little change on |
@cedric-g Ha, I was just about to submit the same change in a PR 😛 It works like a charm with the change, thank you 😄 |
1+ |
Adding the 'multiple' => true option a filter_entity or filter_choice field it causes it to fail when the number of selections is not exactly 1.
If no selections are made I would expect it to ignore the filter, and if more than one is selected I would expect it to include results for both options.
The text was updated successfully, but these errors were encountered: