Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Form] fixed false value being converted to an empty string in ChoiceArrayList#17372

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
ivoaz wants to merge1 commit intosymfony:2.7fromivoaz:ticket_17292

Conversation

@ivoaz
Copy link

QA
Bug fix?yes
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets#17292
LicenseMIT
Doc PR

Whenfalse value is used as a choice value, it is converted to an empty string,
which conflicts with the empty value, if the choice is optional. If the choice
is not optional, then there may be problems with html validation, since required
choice does not allow empty value to be submitted.

This patch disables value casting to string, if the choices containfalse value.

…ArrayListWhen `false` value is used as a choice value, it is converted to an empty string,which conflicts with the empty value, if the choice is optional. If the choiceis not optional, then there may be problems with html validation, since requiredchoice does not allow empty value to be submitted.This patch disables value casting to string, when the choice contains values,that would be converted to an empty string.
@xabbuh
Copy link
Member

I am not sure if this is the right fix but we would need a test in any case that ensures we do not break the behaviour again in the future.

@xabbuhxabbuh added the Form labelJan 14, 2016
@ivoazm
Copy link

Actually, when usingfalse as a key of an array, it is converted to0, not empty string, like casting to string does.

Better solution would be then to convertfalse value to0, instead of casting it to string. This would be consistent with how it worked before withchoices_as_values => false.
What do you think?

@xabbuh
Copy link
Member

sorry for replying earlier@ivoaz

However, I am closing here in favour of#17760 which imo looks more like we should fix the issue and contains tests.

@xabbuhxabbuh closed thisFeb 11, 2016
@ivoaz
Copy link
Author

No problem, I agree with you.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

4 participants

@ivoaz@xabbuh@ivoazm@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp