Index: branches/5.0.x/core/kernel/utility/unit_config_reader.php =================================================================== diff -u -N -r13242 -r13274 --- branches/5.0.x/core/kernel/utility/unit_config_reader.php (.../unit_config_reader.php) (revision 13242) +++ branches/5.0.x/core/kernel/utility/unit_config_reader.php (.../unit_config_reader.php) (revision 13274) @@ -1,6 +1,6 @@ ProcessAllConfigs) return ; $this->FinalStage = true; foreach ($this->configData as $prefix => $config) { - if (in_array($prefix, $this->AfterConfigProcessed)) { - continue; - } - - $this->Application->HandleEvent( new kEvent($prefix.':OnAfterConfigRead') ); - $this->AfterConfigProcessed[] = $prefix; + $this->runAfterConfigRead($prefix); } if (!isset($store_cache)) { @@ -410,6 +405,7 @@ // parse all configs $this->ProcessAllConfigs = true; + $this->AfterConfigProcessed = Array (); $this->includeConfigFiles(MODULES_PATH, false); $this->ParseConfigs(); $this->AfterConfigRead(false); @@ -434,12 +430,7 @@ // call OnAfterConfigRead for cloned configs $new_clones = array_unique($new_clones); foreach ($new_clones as $prefix) { - if (in_array($prefix, $this->AfterConfigProcessed)) { - continue; - } - - $this->Application->HandleEvent( new kEvent($prefix.':OnAfterConfigRead') ); - $this->AfterConfigProcessed[] = $prefix; + $this->runAfterConfigRead($prefix); } } @@ -822,11 +813,21 @@ array_unshift($clones, $prefix); $clones = array_unique($clones); foreach ($clones as $a_prefix) { - $this->Application->HandleEvent( new kEvent($a_prefix.':OnAfterConfigRead') ); + $this->runAfterConfigRead($a_prefix); } } } + function runAfterConfigRead($prefix) + { + if (in_array($prefix, $this->AfterConfigProcessed)) { + return ; + } + + $this->Application->HandleEvent( new kEvent($prefix . ':OnAfterConfigRead') ); + array_push($this->AfterConfigProcessed, $prefix); + } + /** * Reads unit (specified by $prefix) * option specified by $option Index: branches/5.0.x/core/units/helpers/multilanguage_helper.php =================================================================== diff -u -N -r12849 -r13274 --- branches/5.0.x/core/units/helpers/multilanguage_helper.php (.../multilanguage_helper.php) (revision 12849) +++ branches/5.0.x/core/units/helpers/multilanguage_helper.php (.../multilanguage_helper.php) (revision 13274) @@ -1,6 +1,6 @@ Application->UnitConfigReader->loadConfig($regs[1]); - $this->Application->HandleEvent( new kEvent($prefix.':OnAfterConfigRead') ); + $this->Application->UnitConfigReader->runAfterConfigRead($prefix); } $table_name = $this->Application->getUnitOption($prefix, 'TableName'); Index: branches/5.0.x/core/kernel/event_manager.php =================================================================== diff -u -N -r12734 -r13274 --- branches/5.0.x/core/kernel/event_manager.php (.../event_manager.php) (revision 12734) +++ branches/5.0.x/core/kernel/event_manager.php (.../event_manager.php) (revision 13274) @@ -1,6 +1,6 @@ Prefix, $regs) && $this->Application->UnitConfigReader->prefixRegistred($regs[1])) { // this is event from cloned config -> load parent config to create valid clone $this->Application->UnitConfigReader->loadConfig($regs[1]); - $this->Application->HandleEvent( new kEvent($regs[1].':OnAfterConfigRead') ); + $this->Application->UnitConfigReader->runAfterConfigRead($regs[1]); } $event->setEventParam('top_prefix', $this->Application->GetTopmostPrefix($event->Prefix, true));