v3.0.0-beta.96
版本发布时间: 2024-08-29 23:33:35
payloadcms/payload最新发布版本:v3.0.2(2024-11-21 05:11:39)
v3.0.0-beta.96 (2024-08-29)
🚀 Features
- auto-removes localized property from localized fields within other localized fields (#7933) (538b7ee)
- significantly reduce payload install size by removing unnecessary monaco-editor dependency (#7939) (e375f6e)
- reduce package size and amount of dependencies by upgrading json-schema-to-typescript (#7938) (dc12047)
🐛 Bug Fixes
- db-postgres: nested localized arrays (#7962) (ac10bad)
- prevents duplicate active nav indicators (#7943) (de3d7c9)
- improve validation errors for unique fields (#7937) (cc9b877)
- incorrect config.upload types (#7874) (0962850)
⚠️ BREAKING CHANGES
-
auto-removes localized property from localized fields within other localized fields (#7933) (538b7ee)
Payload localization works on a field-by-field basis. As you can nest fields within other fields, you could potentially nest a localized field within a localized field—but this would be redundant and unnecessary. There would be no reason to define a localized field within a localized parent field, given that the entire data structure from the parent field onward would be localized.
Up until this point, Payload would allow you to nest a localized field within another localized field, and this might have worked in MongoDB but it will throw errors in Postgres.
Now, Payload will automatically remove the
localized: true
property from sub-fields withinsanitizeFields
if a parent field is localized.This could potentially be a breaking change if you have a configuration with MongoDB that nests localized fields within localized fields.
Migrating
You probably only need to migrate if you are using MongoDB, as there, you may not have noticed any problems. But in Postgres or SQLite, this would have caused issues so it's unlikely that you've made it too far without experiencing issues due to a nested localized fields config.
In the event you would like to keep existing data in this fashion, we have added a
compatibility.allowLocalizedWithinLocalized
flag to the Payload config, which you can set totrue
, and Payload will then disable this new sanitization step.Set this compatibility flag to
true
only if you have an existing Payload MongoDB database from pre-3.0, and you have nested localized fields that you would like to maintain without migrating.
Contributors
- James Mikrut (@jmikrut)
- Elliot DeNolf (@denolfe)
- Jarrod Flesch (@JarrodMFlesch)
- Alessio Gravili (@AlessioGr)
- Paul (@paulpopus)