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

Asset - Database

-

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

  1. Resolution Note (fix version 2022.2):

    Fixed in 2022.2.0a9

  2. Resolution Note (fix version 2022.1):

    Fixed in 2022.1.0f1

  3. Resolution Note (fix version 2021.3):

    Fixed in 2021.3.1f1

  4. Resolution Note (fix version 2020.3):

    Fixed in 2020.3.33f1

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.