From b5b11842f992bb790a437eb78c71945f1e3a0ddf Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Sun, 2 Nov 2008 00:27:33 +0000 Subject: [PATCH] BUGFIX Checking for array existence before iterating through DataObjectDecorator->provideI18nEntities() git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@65063 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- core/model/DataObjectDecorator.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/model/DataObjectDecorator.php b/core/model/DataObjectDecorator.php index e15d24e37..2fcfc79cb 100755 --- a/core/model/DataObjectDecorator.php +++ b/core/model/DataObjectDecorator.php @@ -155,10 +155,10 @@ abstract class DataObjectDecorator extends Extension implements i18nEntityProvid $entities = array(); $fields = $this->extraDBFields(); $translatableAttributes = array('db','has_one','has_many','many_many'); - foreach($fields as $att => $spec) { + if($fields) foreach($fields as $att => $spec) { if(!in_array($att, $translatableAttributes)) continue; - foreach($spec as $name => $type) { + if($spec) foreach($spec as $name => $type) { $entities["{$this->class}.{$att}_{$name}"] = array($name); } }