fix(drizzle): array/relationship/select hasMany in localized field (#8355)
This PR addresses these issues with localized groups / tabs with Postgres / SQLite: - Array fields inside of localized groups. Fixes https://github.com/payloadcms/payload/issues/8322 - Select fields with `hasMany: true` inside of localized groups. Related to 1, but still needed its own additional logic. - Relationship (non-polymorphic / non has-many) inside of localized groups. Previously, even just trying to define them in the config led to a crash. Fixes https://github.com/payloadcms/payload/issues/8308 Ensures test coverage for localized groups.
This commit is contained in:
@@ -879,7 +879,7 @@ export const traverseFields = ({
|
||||
// add relationship to table
|
||||
relationsToBuild.set(fieldName, {
|
||||
type: 'one',
|
||||
localized: adapter.payload.config.localization && field.localized,
|
||||
localized: adapter.payload.config.localization && (field.localized || forceLocalized),
|
||||
target: tableName,
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user