Fix ChoiceType filter with multiple/expanded options (2nd attempt) #213
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi @Kreyu,
Here is my second attempt to fix #151. After some more digging I was able to solve this (I hope so) by skipping children with
checked
variable set (insrc/Util/FormUtil.php
). Probably not ideal, but maybe a good starting point?I also included fix for using other filters when multiple/expanded filter is present (in
src/Filter/FilterData.php
) and fix for clearing multiple/expanded filter (insrc/Filter/FilterClearUrlGenerator.php
). Sorry for trashy commit history.What do you think about this? If this is not the kind of fix you would like to merge, maybe you have some other idea to solve this?
Today I tested it at my workplace and it looked fine, but of course it needs to be thoroughly tested. @j0r1s could I ask you to test this in your environment?
I also prepared a separate branch in my demo app (branch
test/multiple-choices
), where these changes can be tested. After checkout, runcomposer install
andphp bin/console app:reload-database
. Filter with multiple/expanded options can be found in Filters -> Doctrine ORM tab.If anyone would like to test this PR in their app, it can be done in the following way:
composer update kreyu/data-table-bundle
andphp bin/console cache:clear
.