Index: trunk/kernel/units/general/helpers/multilanguage.php =================================================================== diff -u -r4029 -r4358 --- trunk/kernel/units/general/helpers/multilanguage.php (.../multilanguage.php) (revision 4029) +++ trunk/kernel/units/general/helpers/multilanguage.php (.../multilanguage.php) (revision 4358) @@ -43,6 +43,10 @@ { $table_name = $this->Application->getUnitOption('lang', 'TableName'); $languages_count = $this->Conn->GetOne('SELECT COUNT(*) FROM '.$table_name); + if (!$languages_count) { + // during installation we have not languages, but we need to created custom field columns + $languages_count = 1; + } return $languages_count + 5 - ( $languages_count % 5 ? ($languages_count % 5) : 5 ); } @@ -75,9 +79,14 @@ * Creates missing multilanguage fields in table by specified prefix * * @param string $prefix + * @param bool $refresh Forces config field structure to be re-read from database */ - function createFields($prefix) + function createFields($prefix, $refresh = false) { + if ($refresh) { + $this->Application->HandleEvent( new kEvent($prefix.':OnCreateCustomFields') ); + } + $table_name = $this->Application->getUnitOption($prefix, 'TableName'); $this->curFields = $this->Application->getUnitOption($prefix, 'Fields');