FIX issue where empty composite fields created a fieldlist with empty items

This commit is contained in:
Daniel Hensby 2015-02-06 10:58:01 +00:00
parent a7588b2ac4
commit a0f9535dd4

View File

@ -49,7 +49,8 @@ class CompositeField extends FormField {
} elseif(is_array($children)) {
$this->children = new FieldList($children);
} else {
$children = is_array(func_get_args()) ? func_get_args() : array();
//filter out null/empty items
$children = array_filter(func_get_args());
$this->children = new FieldList($children);
}
$this->children->setContainerField($this);