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

[Forms] Fixed TextType empty_data value explanation#10743

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

Conversation

vudaltsov
Copy link
Contributor

@vudaltsovvudaltsov commentedDec 8, 2018
edited
Loading

#SymfonyConHackDay

Seesymfony/symfony#18357 that introduced a way to use an empty string in models, so setter does not have to be nullable. Usage example:https://github.com/EnMarche/en-marche.fr/blob/master/src/Form/TypeExtension/TextTypeExtension.php#L28

Thanx to@HeahDude for helping me with this PR.

The default value is ``''`` (the empty string).
From an HTTP perspective, submitted data is always a string or an array of strings.
So by default, the form will treat any empty string as null. If you prefer to get
an empty string, explicitly set the ``empty_data`` option to an empty string.
Copy link
Contributor

Choose a reason for hiding this comment

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

@symfony/team-symfony-docs should we care about adding a note to say this possible since 3.2 only?

Copy link
Member

Choose a reason for hiding this comment

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

Not needed because we merge in 3.4, so the minimum Symfony version already has that.

xabbuh reacted with thumbs up emojimindaugasvcs reacted with thumbs down emoji
@HeahDudeHeahDude added the Form labelDec 8, 2018
@HeahDudeHeahDude added this to the3.4 milestoneDec 8, 2018
@vudaltsovvudaltsov changed the titleFixed TextType empty_data value explanation[Forms] Fixed TextType empty_data value explanationDec 8, 2018
@stof
Copy link
Member

stof commentedDec 8, 2018

#SymfonyConHackday2018

vudaltsov and javiereguiluz reacted with hooray emoji

@javiereguiluz
Copy link
Member

Much better explained. Thanks a lot Valentin!

@javiereguiluzjaviereguiluz merged commit5cfff92 intosymfony:3.4Dec 8, 2018
javiereguiluz added a commit that referenced this pull requestDec 8, 2018
…altsov)This PR was merged into the 3.4 branch.Discussion----------[Forms] Fixed TextType empty_data value explanation#SymfonyConHackDaySeesymfony/symfony#18357 that introduced a way to use an empty string in models, so setter does not have to be nullable. Usage example:https://github.com/EnMarche/en-marche.fr/blob/master/src/Form/TypeExtension/TextTypeExtension.php#L28Thanx to@HeahDude for helping me with this PR.Commits-------5cfff92 Fix TextType empty_data value explanation
@vudaltsovvudaltsov deleted the text-empty-data-string branchDecember 8, 2018 13:33
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@javiereguiluzjaviereguiluzjaviereguiluz left review comments

@HeahDudeHeahDudeHeahDude left review comments

Assignees
No one assigned
Projects
None yet
Milestone
3.4
Development

Successfully merging this pull request may close these issues.

5 participants
@vudaltsov@stof@javiereguiluz@HeahDude@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp