Index: trunk/core/install/upgrades.php =================================================================== diff -u -N -r8038 -r8039 --- trunk/core/install/upgrades.php (.../upgrades.php) (revision 8038) +++ trunk/core/install/upgrades.php (.../upgrades.php) (revision 8039) @@ -14,11 +14,13 @@ */ function Upgrade_4_0_2($mode) { - $ml_helper =& $this->Application->recallObject('kMultiLanguageHelper'); - /* @var $ml_helper kMultiLanguageHelper */ - - $lang_count = $ml_helper->getLanguageCount(); - $this->Application->UnitConfigReader->iterateConfigs( Array (&$this, 'updateTextFields', $lang_count) ); + if ($mode == 'after') { + $ml_helper =& $this->Application->recallObject('kMultiLanguageHelper'); + /* @var $ml_helper kMultiLanguageHelper */ + + $lang_count = $ml_helper->getLanguageCount(); + $this->Application->UnitConfigReader->iterateConfigs( Array (&$this, 'updateTextFields', $lang_count) ); + } } /** Index: trunk/core/kernel/utility/unit_config_reader.php =================================================================== diff -u -N -r8029 -r8039 --- trunk/core/kernel/utility/unit_config_reader.php (.../unit_config_reader.php) (revision 8029) +++ trunk/core/kernel/utility/unit_config_reader.php (.../unit_config_reader.php) (revision 8039) @@ -736,6 +736,16 @@ { return isset($this->prefixFiles[$prefix]) ? true : false; } + + function iterateConfigs($callback_function) + { + $this->includeConfigFiles(MODULES_PATH); //make sure to re-read all configs + $this->AfterConfigRead(); + + foreach ($this->configData as $prefix => $config_data) { + $callback_function[0]->$callback_function[1]($prefix, $config_data, $callback_function[2]); + } + } } Index: trunk/core/units/general/helpers/multilanguage.php =================================================================== diff -u -N -r7855 -r8039 --- trunk/core/units/general/helpers/multilanguage.php (.../multilanguage.php) (revision 7855) +++ trunk/core/units/general/helpers/multilanguage.php (.../multilanguage.php) (revision 8039) @@ -79,18 +79,6 @@ $this->curIndexCount = count($this->Conn->Query('SHOW INDEXES FROM '.$table_name)); // } } - - /** - * Checks if table exists in database - * - * @param string $table_name - * @return bool - */ - function tableExists($table_name) - { - $sql = 'SHOW TABLES LIKE "'.$table_name.'"'; - return $this->Conn->Query($sql) ? true : false; - } /** * Creates missing multilanguage fields in table by specified prefix @@ -107,7 +95,7 @@ $table_name = $this->Application->getUnitOption($prefix, 'TableName'); $this->curFields = $this->Application->getUnitOption($prefix, 'Fields'); - if (!($table_name && $this->curFields) || ($table_name && !$this->tableExists($table_name))) { + if (!($table_name && $this->curFields) || ($table_name && !$this->Conn->TableFound($table_name))) { // invalid config found or prefix not found return true; }