Skip to content
This repository
Browse code

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...
commit 39a9093715415014dbe248229e5b3729767cf1ee 1 parent e925401
Ingo Schommer authored August 06, 2012

Showing 1 changed file with 4 additions and 10 deletions. Show diff stats Hide diff stats

  1. 14  code/model/SiteTree.php
14  code/model/SiteTree.php
@@ -2712,16 +2712,10 @@ function provideI18nEntities() {
2712 2712
 		if(isset($entities['Page.SINGULARNAME'])) $entities['Page.SINGULARNAME'][3] = FRAMEWORK_DIR;
2713 2713
 		if(isset($entities['Page.PLURALNAME'])) $entities['Page.PLURALNAME'][3] = FRAMEWORK_DIR;		
2714 2714
 
2715  
-		$types = ClassInfo::subclassesFor('SiteTree');
2716  
-		foreach($types as $k => $type) {
2717  
-			$inst = singleton($type);
2718  
-			$entities[$type . '.DESCRIPTION'] = array(
2719  
-				$inst->stat('description'),
2720  
-				
2721  
-				'Description of the page type (shown in the "add page" dialog)'
2722  
-			);
2723  
-		}
2724  
-		
  2715
+		$entities[$this->class . '.DESCRIPTION'] = array(
  2716
+			$this->stat('description'),
  2717
+			'Description of the page type (shown in the "add page" dialog)'
  2718
+		);
2725 2719
 
2726 2720
 		return $entities;
2727 2721
 	}

0 notes on commit 39a9093

Please sign in to comment.
Something went wrong with that request. Please try again.