Skip to content

Duplicating a published document on an upload + drafts collection carries over published _status #16831

@LimChorngUan

Description

@LimChorngUan

Describe the Bug

On a collection that has both upload and versions.drafts enabled, using the Duplicate action on a document whose _status is published produces a new document that is also published.

Expected: The duplicated document is created with _status: 'draft'.

Link to the code that reproduces this issue

https://github.com/LimChorngUan/payload/blob/upload-version-enabled-bug/test/_community/collections/Media/index.ts#L12-L14

Reproduction Steps

  1. Enable drafts on media collection:
  2. Create a new media and upload an image
  3. Publish it
  4. Duplicate the media
  5. Observe the newly created (duplicated) media has _status published instead of draft.

Which area(s) are affected?

area: core

Environment Info

v3.85.0

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions