Fallback locale option for arrays always resets to true after saving and displays even if array isn't required
Opened this issue · 0 comments
urbanczykb commented
Describe the Bug
When using the "Fallback locale" option for array fields, the checkbox state does not persist correctly.
Even if the option is disabled (unchecked) and the document is saved, after refreshing the admin panel the checkbox always appears as checked.
On the next save, the value is stored as true, regardless of the actual intended state.
Link to the code that reproduces this issue
https://github.com/urbanczykb/fallback-locale-bug
Reproduction Steps
Configuration:
- Create a global with a localized array field.
- Do not mark that array as required
- In payload.config.ts set localization object with at least two languages
CMS:
- Go to global created in first step
- Observe that the fallback locale is present
- Switch to non-default locale in the admin panel
- Disable the Fallback locale option for that array.
- Save the document.
- Refresh the page (F5).
- Observe that the Fallback locale checkbox is checked again.
- Save the document once more → the value is stored as true.
Expected behavior
- The Fallback locale checkbox shouldn't be checked.
- The checkbox shouldn't be displayed according to #12396
Which area(s) are affected? (Select all that apply)
area: ui
Environment Info
Payload version: 3.55.1
Database: MongoDB