[Form] Fix constraints could be null if not set#16897
Closed
DZunke wants to merge 4 commits intosymfony:2.3from
DZunke:fix/null-constraints
Closed
[Form] Fix constraints could be null if not set#16897DZunke wants to merge 4 commits intosymfony:2.3from DZunke:fix/null-constraints
DZunke wants to merge 4 commits intosymfony:2.3from
DZunke:fix/null-constraints
Conversation
If the form options has no key for constraints the default should be an empty array to be ignored by the loop.
Contributor
|
Can you add a test case please? |
Contributor
Author
|
@jakzal hope the test is ok. needed to get my own FormBuilder Instance cause the default "getBuilder" method used by all other tests has default options including the constraints index. |
Contributor
There was a problem hiding this comment.
Can you see any advantage of creating a dummy double for stdClass rather than simply creating the object?
Contributor
Author
There was a problem hiding this comment.
Nope. I'd only copied cause of the lack of knowledge in writing tests. Thanks for the Hint!
Contributor
There was a problem hiding this comment.
Can we call it testMissingConstraintIndex()?
Member
|
Thank you @DZunke. |
fabpot
added a commit
that referenced
this pull request
Jan 25, 2016
This PR was squashed before being merged into the 2.3 branch (closes #16897). Discussion ---------- [Form] Fix constraints could be null if not set | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - If the form options has no key for constraints the default should be an empty array to be ignored by the loop in the FormValidator. The default without this fix is ```null``` and foreach will throw an error. The "Bug" also still exists in master-Branch. Commits ------- f80e0eb [Form] Fix constraints could be null if not set
Merged
This was referenced Feb 28, 2016
Merged
Merged
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
If the form options has no key for constraints the default should be an empty array to be ignored by the loop in the FormValidator. The default without this fix is
nulland foreach will throw an error.The "Bug" also still exists in master-Branch.