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] minor fixes in ChoiceType options#13156

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

Merged
OskarStark merged 1 commit intosymfony:3.4fromHeahDude:fix-form-options
Feb 18, 2020

Conversation

@HeahDude
Copy link
Contributor

Revival of#6393

return strtoupper($category->getName());
// a property path can by used to define the options below
'choice_value' => 'name',
// the empty value can be passed if there is a placeholder

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I don't understand this comment either:

the empty value can be passed if there is a placeholder

We're describing thechoice_label option ... but we talk about "empty value" and "placeholder". I don't see the relation between all this.

Copy link
ContributorAuthor

@HeahDudeHeahDudeFeb 17, 2020
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

When a placeholder is set among the choice list it is the empty value (null as a choice and empty string as value). When the placeholder is not explicitly defined but the field is not required the component adds it as first choice so we can select no choices (opposite of required).
So all callbacks should handle this case, I should better explain that in a dedicated caution I guess.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Yes ... maybe a super short comment before the callback that accepts nullable types mentioning that you need that in case you use placeholders ...

... and then maybe a caution message with some more details like you explained in this comment. Thanks!

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I've pushed acaution

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

For the recordsymfony/symfony#17787

Copy link
Contributor

@OskarStarkOskarStark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

👍🏻

@OskarStark
Copy link
Contributor

Thank you Jules.

OskarStark added a commit that referenced this pull requestFeb 18, 2020
This PR was squashed before being merged into the 3.4 branch.Discussion----------[Form] minor fixes in ChoiceType optionsRevival of#6393Commits-------4ee4102 [Form] minor fixes in ChoiceType options
@OskarStarkOskarStark merged commit4ee4102 intosymfony:3.4Feb 18, 2020
@HeahDudeHeahDude deleted the fix-form-options branchFebruary 18, 2020 07:51
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@javiereguiluzjaviereguiluzjaviereguiluz left review comments

@OskarStarkOskarStarkOskarStark approved these changes

@xabbuhxabbuhAwaiting requested review from xabbuhxabbuh is a code owner

Assignees

No one assigned

Projects

None yet

Milestone

3.4

Development

Successfully merging this pull request may close these issues.

4 participants

@HeahDude@OskarStark@javiereguiluz@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp