Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork5.3k
[Form] Added information about float choice lists#4241
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
Uh oh!
There was an error while loading.Please reload this page.
Conversation
stof commentedSep 17, 2014
note that this is also useful to choose boolean values, or |
reference/forms/types/choice.rst Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
you should add the use statement
peterrehm commentedSep 17, 2014
Thank you for the information, just updated accordingly and squashed the commits. |
reference/forms/types/choice.rst Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I think we can rephrase this a bit (and also link to thechoice_list option):
..tip:: When the values to choose from are not integers or strings (but e.g. floats or booleans), you should use the `choice_list`_ option instead. With this option you are able to keep the original data format which is important to ensure that the user input is validated properly.
I'm not sure if the part about database updates is that important. What do you think about this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I don't think the doctrine update should be mentionned. It is not even the main issue. There is worse than the noop update: in case of edition, the wrong value will be initially selected when using the wrong type, because Symfony uses strict comparison to choose the value
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Well I am unsure about this. However as a side effect you have those updates which might cause updated timestamps, called listeners just based on an altered value. I have added it again to raise awareness, however I am fine with removing it. You guys can decide.
weaverryan commentedOct 2, 2014
This is a nice note - I've merged it into the 2.3 branch. Thanks Peter! |
Added an information about the possibility to have a choice list with float values.
Relates tosymfony/symfony#11849