From a809289a2501ed1637505d489b316a60961a107e Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Mon, 17 May 2010 03:17:09 +0000 Subject: [PATCH] MINOR Removed duplicated code in i18nTextCollector, more defensive checks for get_owner_module() git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@104992 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- core/i18nTextCollector.php | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/core/i18nTextCollector.php b/core/i18nTextCollector.php index 7be917b81..b4480069f 100644 --- a/core/i18nTextCollector.php +++ b/core/i18nTextCollector.php @@ -94,6 +94,7 @@ class i18nTextCollector extends Object { // we store the master string tables $processedEntities = $this->processModule($module); + if(isset($entitiesByModule[$module])) { $entitiesByModule[$module] = array_merge_recursive($entitiesByModule[$module], $processedEntities); } else { @@ -102,24 +103,14 @@ class i18nTextCollector extends Object { // extract all entities for "foreign" modules (fourth argument) foreach($entitiesByModule[$module] as $fullName => $spec) { - if(isset($spec[3]) && $spec[3] != $module) { + if(isset($spec[3]) && $spec[3] && $spec[3] != $module) { $othermodule = $spec[3]; if(!isset($entitiesByModule[$othermodule])) $entitiesByModule[$othermodule] = array(); unset($spec[3]); $entitiesByModule[$othermodule][$fullName] = $spec; unset($entitiesByModule[$module][$fullName]); } - } - - // extract all entities for "foreign" modules (fourth argument) - foreach($entitiesByModule[$module] as $fullName => $spec) { - if(isset($spec[3]) && $spec[3] != $module) { - $othermodule = $spec[3]; - if(!isset($entitiesByModule[$othermodule])) $entitiesByModule[$othermodule] = array(); - unset($spec[3]); - $entitiesByModule[$othermodule][$fullName] = $spec; - } - } + } } // Write the generated master string tables