ExtensibleSet: remove empty components

fixes #11360
This commit is contained in:
Thomas Gelf 2016-05-19 15:02:30 +02:00
parent 06f862618e
commit 8a6f7c0e38
1 changed files with 15 additions and 0 deletions

View File

@ -15,6 +15,21 @@ class ExtensibleSet extends FormElement
// private $multiOptions;
public function getValue()
{
$value = parent::getValue();
if (! is_array($value)) {
$value = array($value);
}
$value = array_filter($value, 'strlen');
if (empty($value)) {
return null;
}
return $value;
}
public function isValid($value, $context = null)
{
if ($value === null) {