10000 [Form] FixCheckboxInputListener can cause an UnexpectedTypeException · Issue #5190 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content
8000

[Form] FixCheckboxInputListener can cause an UnexpectedTypeException #5190

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
cs278 opened this issue Aug 6, 2012 · 2 comments
Closed

[Form] FixCheckboxInputListener can cause an UnexpectedTypeException #5190

cs278 opened this issue Aug 6, 2012 · 2 comments

Comments

@cs278
Copy link
Contributor
cs278 commented Aug 6, 2012

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.

@webmozart
Copy link
Contributor

Related to #5113

@webmozart
Copy link
Contributor

Fixed in the referenced PR.

fabpot added a commit that referenced this issue Sep 10, 2013
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
@fabpot fabpot closed this as completed Sep 10, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants
0