BUG SiteTree->provideI18nEntities() limited to class

Called for each subclass by the collector,
so we don't need to aggregate here.
In fact, its harmful because it causes entities
to be placed in the wrong definitions file.
The <class>.DESCRIPTION entity was always placed in cms/lang/en.yml,
regardless of the original location of the file containing the class.
This commit is contained in:
Ingo Schommer 2012-08-06 14:28:04 +02:00
parent e925401cc3
commit 39a9093715

View File

@ -2712,16 +2712,10 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
if(isset($entities['Page.SINGULARNAME'])) $entities['Page.SINGULARNAME'][3] = FRAMEWORK_DIR;
if(isset($entities['Page.PLURALNAME'])) $entities['Page.PLURALNAME'][3] = FRAMEWORK_DIR;
$types = ClassInfo::subclassesFor('SiteTree');
foreach($types as $k => $type) {
$inst = singleton($type);
$entities[$type . '.DESCRIPTION'] = array(
$inst->stat('description'),
'Description of the page type (shown in the "add page" dialog)'
);
}
$entities[$this->class . '.DESCRIPTION'] = array(
$this->stat('description'),
'Description of the page type (shown in the "add page" dialog)'
);
return $entities;
}