@@ -38,13 +38,12 @@ $t_custom_fields = array(); # Get custom field id of primary keys foreach($t_linked_ids as $cf_id) { $t_def = custom_field_get_definition($cf_id); $t_custom_col_name = $g_custom_field_identifier . $t_def['name']; - - if(isset($f_columns[$t_custom_col_name])) { - $t_custom_fields[$t_custom_fields] = $cf_id; + if(in_array($t_custom_col_name,$f_columns)) { + $t_custom_fields[$t_custom_col_name] = $cf_id; } if(isset($f_keys[$t_custom_col_name])) { $f_keys[$t_custom_col_name] = $cf_id; } @@ -273,10 +272,12 @@ foreach( $t_file_content as $t_file_row ) { $aColumn = 'category_id'; break; default : $valueSet = false; + $t_id = $t_custom_fields[$aColumn]; + $t_def = custom_field_get_definition($t_id); if(isset($t_custom_fields[$aColumn])) { # Prepare value $t_value = get_column_value( $aColumn , $t_file_row ); if( ($t_value != '') && ($t_def['type'] == CUSTOM_FIELD_TYPE_DATE) ) { $t_value = is_numeric($t_value) ? $t_value : strtotime($t_value); @@ -322,10 +323,11 @@ foreach( $t_file_content as $t_file_row ) { } } # Set custom fields (can be set only after bug creation) foreach($t_custom_fields_to_set as $t_id => $t_value) { + $t_def = custom_field_get_definition($t_id); if( custom_field_set_value( $t_id, $t_bug_id, $t_value ) ) { # Mantis core doesn't update "last_updated" when setting custom fields bug_update_date( $t_bug_id ); } else {