BUGFIX Making less assumptions about object structure in FieldSet->addFieldToTab() error messages

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@64007 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2008-10-09 15:15:39 +00:00
parent 950560e188
commit 18855687fc

View File

@ -230,7 +230,8 @@ class FieldSet extends DataObjectSet {
$currentPointer = new Tab($part);
$parentPointer->push($currentPointer);
} else {
user_error("FieldSet::addFieldToTab() Tried to add a tab to object '{$parentPointer->class}.{$parentPointer->Name()}' - '$part' didn't exist.", E_USER_ERROR);
$withName = ($parentPointer->hasMethod('Name')) ? " named {$parentPointer->Name()}" : null;
user_error("FieldSet::addFieldToTab() Tried to add a tab to object '{$parentPointer->class}{$withName}' - '$part' didn't exist.", E_USER_ERROR);
}
}
}