Skip to content

[Form][2.0] wrong label when its value is "0" #6862

Closed
@Cethy

Description

@Cethy

I have a choice type with a choice which is labelled "0", when I display it, I have 1 (which is the position of the choice in the choiceList) instead of 0 in my label.

The problem comes from FieldType::55 :
$builder->setAttribute('label', $options['label'] ?: $this->humanize($builder->getName()));
should be
$builder->setAttribute('label', strlen($options['label']) ? $options['label'] : $this->humanize($builder->getName()))

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions