mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
ENHANCEMENT: more robust conditional check before we go to foreach loop, more robust conditional checking before we call a FormField function where we are not sure the caller is a FormField object.
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@73435 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
bb4fe5299d
commit
3973a6a47e
@ -32,8 +32,12 @@ class FieldSet extends DataObjectSet {
|
||||
$itemsArr = (!is_array($items) || count(func_get_args()) > 1) ? func_get_args() : $items;
|
||||
parent::__construct($itemsArr);
|
||||
|
||||
foreach($this->items as $item) {
|
||||
$item->setContainerFieldSet($this);
|
||||
if(isset($this->items)&&count($this->items)){
|
||||
foreach($this->items as $item) {
|
||||
if(isset($item)&&is_a($item,"FormField")){
|
||||
$item->setContainerFieldSet($this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user