mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
API CHANGE: In FieldSet::removeByName(), only match on field Title() if field Name() isn't set.
This commit is contained in:
parent
5dd03ca9fb
commit
2b991629b8
@ -179,7 +179,10 @@ class FieldSet extends DataObjectSet {
|
||||
|
||||
foreach($this->items as $i => $child) {
|
||||
if(is_object($child)){
|
||||
if(($child->Name() == $fieldName || $child->Title() == $fieldName) && (!$dataFieldOnly || $child->hasData())) {
|
||||
$childName = $child->Name();
|
||||
if(!$childName) $childName = $child->Title();
|
||||
|
||||
if(($childName == $fieldName) && (!$dataFieldOnly || $child->hasData())) {
|
||||
array_splice( $this->items, $i, 1 );
|
||||
break;
|
||||
} else if($child->isComposite()) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user