You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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()))
The text was updated successfully, but these errors were encountered:
This PR was merged into the 2.0 branch.
Commits
-------
f8812b2 [Form] Fixed "label" option to accept the value "0"
Discussion
----------
[Form] Fixed "label" option to accept the value "0"
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #6862
| License | MIT
| Doc PR | -
@fabpot: This commit will cause troubles when merging 2.0 into 2.1 and up. Tell me if you need help upon conflict resolution.
This PR was merged into the 2.1 branch.
Commits
-------
00fbb7e [Form] Added test for "label" option to accept the value "0"
Discussion
----------
[Form] Added test for "label" option to accept the value "0"
| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #6862
| License | MIT
| Doc PR | -
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()))
The text was updated successfully, but these errors were encountered: