BUGFIX Undefined variable when calling DataObject::many_many_extraFields() and relation name couldn't be found for the component (from r108400)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@112726 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sam Minnee 2010-10-18 22:53:59 +00:00
parent 2058ee31ee
commit ca7edd5ca5

View File

@ -1686,6 +1686,7 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity
foreach($classes as $class) {
if(in_array($class, array('ViewableData', 'Object', 'DataObject'))) continue;
$relationName = null;
// Find extra fields for one component
if($component) {
@ -1704,7 +1705,6 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity
$candidateManyMany = $SNG_candidate->stat('belongs_many_many');
// Find the relation given the class
$relationName = null;
if($candidateManyMany) foreach($candidateManyMany as $relation => $relatedClass) {
if($relatedClass == $class) {
$relationName = $relation;