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

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@108400 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sean Harvey 2010-07-23 03:13:15 +00:00 committed by Sam Minnee
parent 900d4ea23a
commit 52f1d1b17d

View File

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