Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork5.3k
Changed option guessing to maxlength#7273
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.
Changes fromall commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -542,11 +542,11 @@ the guessed field. | ||
| .. index:: | ||
| single: Forms; Field type guessing | ||
| FieldAttributes Guessing | ||
Contributor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. I understand why you did it but this change is not needed since guessers are about to change type's options, actually ContributorAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Do you think we should just remove the maxlength part and keep required? Contributor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. No I don't :) I was suggesting to add undocumented guessed options, not to remove these ;) Contributor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. This change also needs to be reverted. | ||
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
| In addition to guessing the "type" for a field, Symfony can also try to guess | ||
| the correct values of a number of fieldattributes. | ||
| .. tip:: | ||
| @@ -557,13 +557,13 @@ the correct values of a number of field options. | ||
| field type options can then be guessed from that information. | ||
| ``required`` | ||
| The ``required``html attribute can be guessed based on the validation rules (i.e. is | ||
| the field ``NotBlank`` or ``NotNull``) or the Doctrine metadata (i.e. is the | ||
| field ``nullable``). This is very useful, as your client-side validation will | ||
| automatically match your validation rules. | ||
| ``maxlength`` | ||
Contributor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Thanks for opening this PR! This change is legit, but I think you should also replace | ||
| If the field is some sort of text field, then the ``maxlength``html attribute can be | ||
| guessed from the validation constraints (if ``Length`` or ``Range`` is used) or | ||
| from the Doctrine metadata (via the field's length). | ||