Search Unity

Question MissingFIeldException: Field at index does not exist

Discussion in 'Localization Tools' started by gorka_c, Nov 17, 2022.

  1. gorka_c

    gorka_c

    Joined:
    Oct 10, 2022
    Posts:
    13
    Hi, I have exported the string table in csv format, and then edited some translations. When I try importing that csv file, uUnity gives me this error: MissingFieldException: Field at index '2' does not exist. You can ignore missing fields by setting MissingFieldFound to null".
    Why does this happen and/or how can I set "MissingFieldFound" to null?
    Thanks!
     
  2. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,293
    Can you share the full log file? Have you renamed any of the columns?
     
  3. gorka_c

    gorka_c

    Joined:
    Oct 10, 2022
    Posts:
    13
    I renamed the key field name, but I have tried with the original name again and it shows the same error. This is the full error:
    Code (CSharp):
    1. MissingFieldException: Field at index '1' does not exist. You can ignore missing fields by setting MissingFieldFound to null.
    2. CsvHelper.Configuration.ConfigurationFunctions.MissingFieldFound (System.String[] headerNames, System.Int32 index, CsvHelper.ReadingContext context) (at <20147215d023497caf9ddab1d6e6c98d>:0)
    3. CsvHelper.CsvReader.GetField (System.Int32 index) (at <20147215d023497caf9ddab1d6e6c98d>:0)
    4. UnityEditor.Localization.Plugins.CSV.Columns.LocaleColumns.ReadRow (UnityEngine.Localization.Tables.SharedTableData+SharedTableEntry keyEntry, CsvHelper.CsvReader reader) (at Library/PackageCache/com.unity.localization@1.3.2/Editor/Plugins/CSV/Columns/LocaleColumns.cs:126)
    5. UnityEditor.Localization.Plugins.CSV.Csv.ImportInto (System.IO.TextReader reader, UnityEditor.Localization.StringTableCollection collection, System.Collections.Generic.IList`1[T] columnMappings, System.Boolean createUndo, UnityEditor.Localization.Reporting.ITaskReporter reporter, System.Boolean removeMissingEntries) (at Library/PackageCache/com.unity.localization@1.3.2/Editor/Plugins/CSV/CSV.cs:222)
    6. UnityEditor.Localization.Plugins.CSV.CsvExtensionPropertyDrawer.Import (System.String path, UnityEditor.Localization.StringTableCollection collection, System.Collections.Generic.IList`1[T] columns) (at Library/PackageCache/com.unity.localization@1.3.2/Editor/Plugins/CSV/CsvExtensionPropertyDrawer.cs:86)
    7. UnityEditor.Localization.Plugins.CSV.CsvExtensionPropertyDrawer.OnGUI (UnityEditor.Localization.Plugins.CSV.CsvExtensionPropertyDrawerData data, UnityEngine.Rect position, UnityEditor.SerializedProperty property, UnityEngine.GUIContent label) (at Library/PackageCache/com.unity.localization@1.3.2/Editor/Plugins/CSV/CsvExtensionPropertyDrawer.cs:136)
    8. UnityEditor.Localization.UI.PropertyDrawerExtended`1[TData].OnGUI (UnityEngine.Rect position, UnityEditor.SerializedProperty property, UnityEngine.GUIContent label) (at Library/PackageCache/com.unity.localization@1.3.2/Editor/UI/Utility/PropertyDrawerExtended.cs:52)
    9. UnityEditor.PropertyDrawer.OnGUISafe (UnityEngine.Rect position, UnityEditor.SerializedProperty property, UnityEngine.GUIContent label) (at <4e64905d831f4883a53259ef37fb023b>:0)
    10. UnityEditor.PropertyHandler.OnGUI (UnityEngine.Rect position, UnityEditor.SerializedProperty property, UnityEngine.GUIContent label, System.Boolean includeChildren, UnityEngine.Rect visibleArea) (at <4e64905d831f4883a53259ef37fb023b>:0)
    11. UnityEditor.PropertyHandler.OnGUI (UnityEngine.Rect position, UnityEditor.SerializedProperty property, UnityEngine.GUIContent label, System.Boolean includeChildren) (at <4e64905d831f4883a53259ef37fb023b>:0)
    12. UnityEditor.EditorGUI.PropertyFieldInternal (UnityEngine.Rect position, UnityEditor.SerializedProperty property, UnityEngine.GUIContent label, System.Boolean includeChildren) (at <4e64905d831f4883a53259ef37fb023b>:0)
    13. UnityEditor.EditorGUI.PropertyField (UnityEngine.Rect position, UnityEditor.SerializedProperty property, UnityEngine.GUIContent label, System.Boolean includeChildren) (at <4e64905d831f4883a53259ef37fb023b>:0)
    14. UnityEditor.Localization.UI.ReorderableListExtended.DrawElement (UnityEngine.Rect rect, System.Int32 idx, System.Boolean isActive, System.Boolean isFocused) (at Library/PackageCache/com.unity.localization@1.3.2/Editor/UI/Utility/ReorderableListExtended.cs:81)
    15. UnityEditorInternal.ReorderableList.DoListElements (UnityEngine.Rect listRect, UnityEngine.Rect visibleRect) (at <4e64905d831f4883a53259ef37fb023b>:0)
    16. UnityEditorInternal.ReorderableList.DoLayoutList () (at <4e64905d831f4883a53259ef37fb023b>:0)
    17. UnityEditor.Localization.UI.LocalizationTableCollectionEditor.OnInspectorGUI () (at Library/PackageCache/com.unity.localization@1.3.2/Editor/UI/Tables/LocalizationTableCollectionEditor.cs:211)
    18. UnityEditor.UIElements.InspectorElement+<>c__DisplayClass59_0.<CreateIMGUIInspectorFromEditor>b__0 () (at <46976ad9004e4c8ca11353e8bb94e264>:0)
    19. UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)
     
  4. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,293
    It looks like it's missing one of the language columns. Could you please file a bug report? We should be able to improve on the error message and add support for missing columns.