[Form][CheckboxType] Remove _false_is_empty flag
This commit is contained in:
parent
eda7aad51e
commit
6fac6d4086
@ -33,7 +33,6 @@ class CheckboxType extends AbstractType
|
||||
// doing so also calls setDataLocked(true).
|
||||
$builder->setData(isset($options['data']) ? $options['data'] : false);
|
||||
$builder->addViewTransformer(new BooleanToStringTransformer($options['value'], $options['false_values']));
|
||||
$builder->setAttribute('_false_is_empty', true); // @internal - A boolean flag to treat false as empty, see Form::isEmpty() - Do not rely on it, it will be removed in Symfony 5.1.
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -742,9 +742,7 @@ class Form implements \IteratorAggregate, FormInterface, ClearableErrorsInterfac
|
||||
// arrays, countables
|
||||
((\is_array($this->modelData) || $this->modelData instanceof \Countable) && 0 === \count($this->modelData)) ||
|
||||
// traversables that are not countable
|
||||
($this->modelData instanceof \Traversable && 0 === iterator_count($this->modelData)) ||
|
||||
// @internal - Do not rely on it, it will be removed in Symfony 5.1.
|
||||
(false === $this->modelData && $this->config->getAttribute('_false_is_empty'));
|
||||
($this->modelData instanceof \Traversable && 0 === iterator_count($this->modelData));
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user