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

Appearance settings

Document that "empty_data" requires data in view format #6340

Copy link
Copy link
Closed
@webmozart

Description

@webmozart
Issue body actions

It should be documented with the "empty_data" option that the data must be passed in view format, in case that differs from model format. For IntegerType, for example, "empty_data" must be set to a string value, not an integer (conversely to what you would intuitively expect):

$builder->add('number', IntegerType::class, [
    'empty_data' => '0', // not: 0
]);

See symfony/symfony#18047

Metadata

Metadata

Assignees

No one assigned

    Labels

    FormKeep openactionableClear and specific issues ready for anyone to take them.Clear and specific issues ready for anyone to take them.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.