(db-postgres): localized group and localized fields inside of group are broken.
Link to reproduction
https://github.com/r1tsuu/payload/tree/postgres-reproduction
Describe the Bug
Given the collection config:
import type { CollectionConfig } from 'payload/types'
export const localizedSlug = 'localized '
export const Localized: CollectionConfig = {
slug: localizedSlug,
fields: [
{
name: 'groupLocalized',
localized: true,
type: 'group',
fields: [
{
name: 'title',
type: 'text',
},
],
},
{
name: 'group',
type: 'group',
fields: [
{
localized: true,
name: 'title',
type: 'text',
},
],
},
],
}
In both cases (localized inside and localized group itself) data is not saved to the database for properly, from my integration test i have this (null data for last row with en locale):
In the admin ui it just shows you the data in wrong language
Found this while was writing integration test for my PR https://github.com/payloadcms/payload/pull/5942
To Reproduce
Run
pnpm test int:postgres _community - doesnt pass
pnpm test int _community - passes with mongodb, which should confirm that something is wrong.
Payload Version
2 and 3
Adapters and Plugins
db-postgres
i think i could handle it, can assign to me
Any progress on this issue? We just ran into this problem as well.
Any progress on this issue? We just ran into this problem as well.
I opened a PR https://github.com/payloadcms/payload/pull/6158
The PR looks great! Good work @r1tsuu, are you able to resolve the merge conflict and we'll take it from there? We should be able to get this merged and ready for the next release.
I am closing this. It will be out in the next release of 3.0 beta.
I may do a backport of all the database changes made in beta back to 2.x based on demand.
Thanks @r1tsuu for this fix.
This issue has been automatically locked. Please open a new issue if this issue persists with any additional detail.