Permalink
Browse files

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.
  • Loading branch information...
1 parent e925401 commit 39a9093715415014dbe248229e5b3729767cf1ee @chillu chillu committed Aug 6, 2012
Showing with 4 additions and 10 deletions.
  1. +4 −10 code/model/SiteTree.php
@@ -2712,16 +2712,10 @@ function provideI18nEntities() {
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;
}

0 comments on commit 39a9093

Please sign in to comment.