You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Whilst testing the validation on an expanded multiple choice form element, I changed one of the checkbox values to a value not in the choice list. This yielded an UnexpectedTypeException at Symfony/Component/Form/Form.php line 576. The problem is caused by the array_combine() in FixCheckboxInputListener::preBind() returning false because $indicies contains 2 elements but $values contains 3.
The text was updated successfully, but these errors were encountered:
This PR was merged into the master branch.
Discussion
----------
[Form] Fixed expanded choice field to be marked invalid when unknown choices are submitted
#7939 must be merged before this PR is merged.
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #5113, #5190
| License | MIT
| Doc PR | -
TODO:
- [x] test EntityChoiceList for stricter rules
- [ ] test ModelChoiceList for stricter rules
- [x] remove/deprecate the ChoiceList::getIndicesFor*() methods
Commits
-------
9efdb8e [Form] Deprecated ChoiceList::getIndicesFor*() methods
67ba131 [DoctrineBridge] Improved test coverage of EntityChoiceList
31e5ce5 [Form] Improved test coverage of ChoiceList classes
6283b0e [Form] Fixed expanded choice field to be marked invalid when unknown choices are submitted
79a214f [Form] Fixed ChoiceList::get*By*() methods to preserve order and array keys
62fbed6 [Form] Removed usage of the ChoiceList::getIndicesFor*() methods where they don't offer any performance benefit
Whilst testing the validation on an expanded multiple choice form element, I changed one of the checkbox values to a value not in the choice list. This yielded an
UnexpectedTypeException
atSymfony/Component/Form/Form.php line 576
. The problem is caused by thearray_combine()
inFixCheckboxInputListener::preBind()
returning false because$indicies
contains 2 elements but$values
contains 3.The text was updated successfully, but these errors were encountered: