Index: branches/RC/core/units/custom_data/custom_data_event_handler.php =================================================================== diff -u -r8929 -r9234 --- branches/RC/core/units/custom_data/custom_data_event_handler.php (.../custom_data_event_handler.php) (revision 8929) +++ branches/RC/core/units/custom_data/custom_data_event_handler.php (.../custom_data_event_handler.php) (revision 9234) @@ -94,11 +94,13 @@ $virtual_fields = $this->Application->getUnitOption($prefix, 'VirtualFields', Array()); $cf_helper =& $this->Application->recallObject('InpCustomFieldsHelper'); - $field_options = Array('type' => 'string', 'not_null' => 1, 'default' => ''); $ml_formatter =& $this->Application->recallObject('kMultiLanguage'); /* @var $ml_formatter kMultiLanguage */ foreach ($custom_fields as $custom_id => $custom_params) { + $custom_name = $custom_params['FieldName']; + $field_options = Array('type' => 'string', 'not_null' => 1, 'default' => ''); + switch ($custom_params['ElementType']) { case 'date': case 'datetime': @@ -116,11 +118,15 @@ break; default: - unset($field_options['options'], $field_options['formatter']); + if ($custom_params['MultiLingual']) { + $calculated_fields['cust_'.$custom_name.'_Primary'] = 'cust.'.$ml_formatter->LangFieldName('cust_'.$custom_id, true); + $virtual_fields['cust_'.$custom_name.'_Primary'] = $field_options; + $field_options['master_field'] = 'cust_'.$custom_name.'_Primary'; + $field_options['formatter'] = 'kCustomFieldFormatter'; + } break; } - $custom_name = $custom_params['FieldName']; $calculated_fields['cust_'.$custom_name] = 'cust.'.$ml_formatter->LangFieldName('cust_'.$custom_id, !$custom_params['MultiLingual']); if (!isset($virtual_fields['cust_'.$custom_name])) { $virtual_fields['cust_'.$custom_name] = Array();