fixed field is null
This commit is contained in:
parent
071d8b7b09
commit
78df78c584
|
@ -12,3 +12,4 @@ coverage/
|
|||
/vendor/
|
||||
composer.lock
|
||||
silverstripe-cache/
|
||||
.idea
|
||||
|
|
|
@ -268,14 +268,17 @@ class FieldList extends ArrayList
|
|||
|
||||
// Add the fields to the end of this set
|
||||
foreach ($fields as $field) {
|
||||
// Check if a field by the same name exists in this tab
|
||||
if ($insertBefore) {
|
||||
$tab->insertBefore($insertBefore, $field);
|
||||
} elseif (($name = $field->getName()) && $tab->fieldByName($name)) {
|
||||
// It exists, so we need to replace the old one
|
||||
$this->replaceField($field->getName(), $field);
|
||||
} else {
|
||||
$tab->push($field);
|
||||
// Check if field is not null
|
||||
if($field !== null) {
|
||||
// Check if a field by the same name exists in this tab
|
||||
if ($insertBefore) {
|
||||
$tab->insertBefore($insertBefore, $field);
|
||||
} elseif (($name = $field->getName()) && $tab->fieldByName($name)) {
|
||||
// It exists, so we need to replace the old one
|
||||
$this->replaceField($field->getName(), $field);
|
||||
} else {
|
||||
$tab->push($field);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue