-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Open
Labels
status: verifiedIf an issue has been reproducedIf an issue has been reproduced
Description
Describe the Bug
If a collection contains arrays or blocks with localized fields, copying one locale to another or simply saving the current locale causes other locales to lose their values. It seems that localized values are not merged but instead overwritten. I am using MongoDB, so I'm not sure if this behavior is different with relational databases
Link to the code that reproduces this issue
https://github.com/epranka/payload-locales-save-issue
Reproduction Steps
- Clone the repository.
- Run docker compose up and wait until both the app and MongoDB are ready.
- Open http://localhost:3000/admin.
- Create an account.
- Create a new Page. Enter a title, add at least one item in an array or block with filled fields. In the Content tab, add any layout to avoid validation errors. Then, publish the page.
- Click "Copy to locale" and select the "en" locale.
- Switch back to the previous "lt" locale. You should see that the values in the array and block are lost.
- Click "Copy to locale" and select the "lt" locale.
- Switch back to the previous "en" locale. You should now see that the values are lost in that locale instead. Only the last saved locale retains its values.
Which area(s) are affected? (Select all that apply)
Not sure
Environment Info
Binaries:
Node: 20.13.1
npm: 10.5.2
Yarn: N/A
pnpm: 10.11.0
Relevant Packages:
payload: 3.39.1
next: 15.3.0
@payloadcms/db-mongodb: 3.39.1
@payloadcms/email-nodemailer: 3.39.1
@payloadcms/graphql: 3.39.1
@payloadcms/live-preview: 3.39.1
@payloadcms/live-preview-react: 3.39.1
@payloadcms/next/utilities: 3.39.1
@payloadcms/payload-cloud: 3.39.1
@payloadcms/plugin-form-builder: 3.39.1
@payloadcms/plugin-nested-docs: 3.39.1
@payloadcms/plugin-redirects: 3.39.1
@payloadcms/plugin-search: 3.39.1
@payloadcms/plugin-seo: 3.39.1
@payloadcms/richtext-lexical: 3.39.1
@payloadcms/translations: 3.39.1
@payloadcms/ui/shared: 3.39.1
react: 19.1.0
react-dom: 19.1.0
Operating System:
Platform: linux
Arch: x64
Version: #61.1~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Fri Apr 18 12:20:24 UTC
Available memory (MB): 64167
Available CPU cores: 16
Alief321, tyuen, geeron, kianatrs, fredericlenaerts and 6 more
Metadata
Metadata
Assignees
Labels
status: verifiedIf an issue has been reproducedIf an issue has been reproduced