Search Issue Tracker
Fixed in 2022.2.X
Fixed in 2020.3.X, 2021.3.X, 2022.1.X
Votes
0
Found in
2020.3
2020.3.26f1
2021.2
2022.1
2022.2
Issue ID
1405215
Regression
No
Prefab is not reimported when FormerlySerializedAs is added to script
Reproduction steps:
1. Open the user attached project
2. Open Assets/TestFormerlySerializedAsBug/TestFormerlySerializedAsBug1.cs
3. Open Assets/TestFormerlySerializedAsBug/TestFormerlySerializedAsBug2.cs
4. In TestFormerlySerializedAsBug1.cs rename m_myField1 to m_MyField1
5. In TestFormerlySerializedAsBug2.cs rename m_myField2 to m_MyField2
6. Close the project
7. In TestFormerlySerializedAsBug1.cs rename m_MyField1 back to m_myField1
8. In TestFormerlySerializedAsBug2.cs add the [FormerlySerializedAs("m_myField2")] attribute to the m_MyField2 variable
9. Reopen the project
Expected result: "My Field 1" (Prefab1) and "My Field 2" (Prefab2) values are "data"
Actual result: "My Field 1" (Prefab1) value is "data" but "My Field 2" (Prefab2) value is empty
Reproducible with: 2020.3.30f1, 2021.2.14f1, 2022.1.0b10, 2022.2.0a6
Could not test with: 2019.4.36f1 (errors after downgrade)
Note: The "My Field 2" (Prefab2) value can be restored with a manual Right Click > Reimport operation
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Articulation Body with 'Revolute' Joint Type has erratic behavior when Upper Limit is set to above 360
- WebGL Player fails to render Scene when Terrain with Detail Mesh is added and WebGPU Graphics API is used
- Inconsistent errors are logged when different types are passed into the Query "Q<>" method in UIToolkit and the ancestor VisualElement is null
- Crash on GetMaterialPropertyByIndex when opening a specific Scene
- Discrepancies in the styling are present when using a TSS file instead of a USS file in custom EditorWindow
Resolution Note (fix version 2022.2):
Fixed in 2022.2.0a9
Resolution Note (fix version 2022.1):
Fixed in 2022.1.0f1
Resolution Note (fix version 2021.3):
Fixed in 2021.3.1f1
Resolution Note (fix version 2020.3):
Fixed in 2020.3.33f1