payloadcms / payloadcms/payload
[plugin-import-export] Prefix labels being applied to row fields and unnamed/unlabelled group fields in export fields dropdown
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 44.8k
- Forks
- 4.2k
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 53
Description
Describe the Bug.
Prefix labels are being applied to row fields and unnamed/unlabelled group fields in the Export Options Fields dropdown.
Example:
{
type: 'row',
fields: [
{
type: 'text',
name: 'test1',
label: 'Test1'
},
{
type: 'text',
name: 'test2',
label: 'Test2'
}
]
}
Suggested fix — Prefix labels should be removed in these instances. Change how fields are being reduced in packages/plugin-import-export/src/components/FieldsToExport/reduceFields.tsx
if (!isArrayOrBlocks && fieldHasSubFields(field)) {
const affectsData = fieldAffectsData(field)
return [
...fieldsToUse,
...reduceFields({
disabledFields,
excludeUnsortable,
fields: field.fields,
labelPrefix: affectsData
? combineLabel({
field,
prefix: labelPrefix,
})
: labelPrefix,
path: createNestedClientFieldPath(path, field)
})
]
}
Reproduction Steps
- Install the plugin-import-export plugin
- Enable the plugin-import-export plugin on a collection in the payload.config
- In your collection, add the fields:
{
type: 'row',
fields: [
{
type: 'text',
name: 'test1',
label: 'Test1'
},
{
type: 'text',
name: 'test2',
label: 'Test2'
}
]
}
- Open the exports modal/drawer on the collection list view and select Export
- Select the fields defined in step 3 in the Export Options Fields dropdown
Environment Info
Payload: 3.85.1
Node.js: 22.17.0
Next.js: 16.2.6
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in packages/plugin-import-export/src/components/FieldsToExport/reduceFields.tsx and trace how labels are reduced for row and unnamed group fields. Reproduce the Export Options Fields dropdown with the provided row-field configuration; done when those fields no longer display prefixed labels while other nested field labels retain their intended prefixes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 78/100