fix(plugin-import-export): disabled flag to cascade to nested fields from parent containers (#13199)

### What?

Fixes the `custom.plugin-import-export.disabled` flag to correctly
disable fields in all nested structures including:
- Groups
- Arrays
- Tabs
- Blocks

Previously, only top-level fields or direct children were respected.
This update ensures nested paths (e.g. `group.array.field1`,
`blocks.hero.title`, etc.) are matched and filtered from exports.

### Why?

- Updated regex logic in both `createExport` and Preview components to
recursively support:
  - Indexed array fields (e.g. `array_0_field1`)
  - Block fields with slugs (e.g. `blocks_0_hero_title`)
  - Nested field accessors with correct part-by-part expansion

### How?

To allow users to disable entire field groups or deeply nested fields in
structured layouts.
This commit is contained in:
Patrik
2025-07-17 14:12:58 -04:00
committed by GitHub
parent 12539c61d4
commit 95e373e60b
11 changed files with 156 additions and 41 deletions

View File

@@ -1,4 +1,4 @@
import type { MigrateDownArgs, MigrateUpArgs} from '@payloadcms/db-postgres';
import type { MigrateDownArgs, MigrateUpArgs } from '@payloadcms/db-postgres'
import { sql } from '@payloadcms/db-postgres'

View File

@@ -1,9 +1,9 @@
import * as migration_20250714_201659 from './20250714_201659.js';
import * as migration_20250714_201659 from './20250714_201659.js'
export const migrations = [
{
up: migration_20250714_201659.up,
down: migration_20250714_201659.down,
name: '20250714_201659'
name: '20250714_201659',
},
];
]