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

[Form][Bug][2.7.8+] Bug when using false as a value in an optional choice field #17292

Copy link
Copy link
Closed
@ivoaz

Description

@ivoaz
Issue body actions

After upgrading from 2.7.7 to 2.7.8 I noticed that some choice fields didn't display the empty value.

Example code:

->add('buyback', 'choice', [
    'choices' => [
        'Yes'  => true,
        'No'   => false,
    ],
    'choices_as_values' => true,
    'required'          => false,
]);

Before:
image
After:
image

So far I've found out that the false value is converted to empty string in this line v2.7.7...v2.7.8#diff-780e59a429c485d2d3b8a37fdf62ac59R79.

I think that the false value is displayed instead of empty value because of that.

This bug was introduced in #16705.

Metadata

Metadata

Assignees

No one assigned

    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.