ChoiceFilter
is not working properly when 'multiple' => true
option is used
#6894
Labels
ChoiceFilter
is not working properly when 'multiple' => true
option is used
#6894
Environment
Sonata packages
show
Symfony packages
show
PHP version
Subject
ChoiceFilter
is not working properly when'multiple' => true
option is used.The behavior introduced at #6700 is identifying as default and removing more filter values than it should.
Minimal repository with the bug
N/A
Steps to reproduce
Expected results
The result filters to respect the user's selection.
Actual results
Since the default filter names evaluated here can have duplicated names (
'filter[country][value][]'
in this case), the logic around removing the filters that have default values is not working properly, given the filter names that use array offsets are not exposing these offsets explicitly ('filter[country][value][0]'
,'filter[country][value][1]'
, etc.).By the other hand, I think we could also evaluate to express the array values as a list in order to distinguish the values that are really the default ones (by instance,
['ar', 'fr']
).IMO, all the required fixes should be applied at
Admin.js:convert_query_string_to_object()
or its callers.The text was updated successfully, but these errors were encountered: