Index: branches/5.1.x/core/units/helpers/multilanguage_helper.php =================================================================== diff -u -N -r13935 -r14124 --- branches/5.1.x/core/units/helpers/multilanguage_helper.php (.../multilanguage_helper.php) (revision 13935) +++ branches/5.1.x/core/units/helpers/multilanguage_helper.php (.../multilanguage_helper.php) (revision 14124) @@ -1,6 +1,6 @@ Application->getUnitOption($prefix, 'TableName'); + $this->curFields = $this->Application->getUnitOption($prefix, 'Fields'); + + if (!($table_name && $this->curFields) || ($table_name && !$this->Conn->TableFound($table_name))) { + // invalid config found or prefix not found + return true; + } + + foreach ($this->curFields as $field_name => $field_options) { + $formatter = isset($field_options['formatter']) ? $field_options['formatter'] : ''; + + if ( ($formatter == 'kMultiLanguage') && !isset($field_options['master_field']) ) { + $sql = 'UPDATE ' . $table_name . ' + SET l' . $dst_language . '_' . $field_name . ' = l' . $src_language . '_' . $field_name . ' + WHERE l' . $dst_language . '_' . $field_name . ' = "" OR l' . $dst_language . '_' . $field_name . ' IS NULL'; + $this->Conn->Query($sql); + } + } + } + function deleteField($prefix, $custom_id) { $table_name = $this->Application->getUnitOption($prefix, 'TableName');