## Description In Postgres, localized blocks or arrays that contain other array / block / relationship fields were not properly storing locales in the database. Now they are! Need to check a few things yet: - Ensure test coverage is sufficient - Test localized array, with non-localized array inside of it - Test localized block with relationship field within it - Ensure `_rels` table gets the `locale` column added if a single non-localized relationship exists within a localized array / block Fixes step 6 as identified in #7805
43 lines
905 B
TypeScript
43 lines
905 B
TypeScript
import type { CollectionConfig } from 'payload'
|
|
|
|
export const NestedArray: CollectionConfig = {
|
|
slug: 'nested-arrays',
|
|
fields: [
|
|
{
|
|
name: 'arrayWithBlocks',
|
|
type: 'array',
|
|
localized: true,
|
|
fields: [
|
|
{
|
|
name: 'blocksWithinArray',
|
|
type: 'blocks',
|
|
blocks: [
|
|
{
|
|
slug: 'someBlock',
|
|
fields: [
|
|
{
|
|
name: 'relationWithinBlock',
|
|
type: 'relationship',
|
|
relationTo: 'localized-posts',
|
|
},
|
|
],
|
|
},
|
|
],
|
|
},
|
|
],
|
|
},
|
|
{
|
|
name: 'arrayWithLocalizedRelation',
|
|
type: 'array',
|
|
fields: [
|
|
{
|
|
name: 'localizedRelation',
|
|
type: 'relationship',
|
|
localized: true,
|
|
relationTo: 'localized-posts',
|
|
},
|
|
],
|
|
},
|
|
],
|
|
}
|