From 39a9093715415014dbe248229e5b3729767cf1ee Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Mon, 6 Aug 2012 14:28:04 +0200 Subject: [PATCH] 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 .DESCRIPTION entity was always placed in cms/lang/en.yml, regardless of the original location of the file containing the class. --- code/model/SiteTree.php | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/code/model/SiteTree.php b/code/model/SiteTree.php index a05cbda3..d10a1079 100644 --- a/code/model/SiteTree.php +++ b/code/model/SiteTree.php @@ -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; }