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
This commit is contained in:
Ingo Schommer 2008-11-02 00:27:33 +00:00
parent 5c4403d57e
commit b5b11842f9

View File

@ -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);
}
}