Skip to content

fix(plugin-import-export): respect defaultVersionStatus for versioned imports#15639

Open
naaa760 wants to merge 1 commit intopayloadcms:mainfrom
naaa760:fix/plug-imp-def-ver-pub
Open

fix(plugin-import-export): respect defaultVersionStatus for versioned imports#15639
naaa760 wants to merge 1 commit intopayloadcms:mainfrom
naaa760:fix/plug-imp-def-ver-pub

Conversation

@naaa760
Copy link
Contributor

@naaa760 naaa760 commented Feb 16, 2026

What?

  • Imports into versioned collections were always created as drafts even when defaultVersionStatus: 'published' was set.

Why?

  • We removed _status from the payload, so Payload’s default 'draft' was applied.

How?

  • We set and pass createData._status from the row or defaultVersionStatus instead of deleting it for versioned collections.

Fixes : #15627

@@ -178,6 +178,7 @@ async function processImportBatch({
const statusValue = createData._status || options.defaultVersionStatus

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see the change we need here is

Suggested change
const statusValue = createData._status || options.defaultVersionStatus
const statusValue = options.defaultVersionStatus || createData._status

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and remove default value for defaultVersionStatus as published and make it undefined

Copy link

@hedaukartik hedaukartik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added my comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

plugin-import-export defaultVersionStatus: 'published' still creates drafts in versioned collections

2 participants