API CHANGE: In FieldSet::removeByName(), only match on field Title() if field Name() isn't set.

This commit is contained in:
Sam Minnee 2009-11-22 16:48:13 +13:00
parent 5dd03ca9fb
commit 2b991629b8

View File

@ -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()) {