Skip to content

"Revert to published" publishes draft values for fields absent from the published document #18671

Open

Description

@damnsamn

Describe the Bug

Clicking Revert to published retains and publishes a draft field value when that field was absent from the published document. The public API then returns the draft text.

Reproduced on 3.90.1 with a minimal MongoDB-backed collection, without application hooks or plugins. Existing published text, an explicit empty string, and null revert correctly; an omitted field does not.

Link to the code that reproduces this issue

Minimal configuration and steps are inline below. Affected implementation: Status.performAction.

Reproduction Steps

  1. Add this collection:

    {
      slug: 'posts',
      versions: { drafts: { validate: true } },
      fields: [{ name: 'description', type: 'textarea' }],
    }
  2. Create a published document with the field omitted

  3. Once published empty, enter a description, and Save draft.

  4. Revisit the document, click Revert to published, and confirm.

  5. Read the published document without draft: true.

Expected: Description remains absent; draft changes are discarded.

Actual: The draft description is now published.

The revert action GETs the published document and PATCHes its JSON back. The absent field is omitted from that request, while the update uses the latest draft as its base, retaining the draft value.

Related: #15976 reports a similar symptom for PostgreSQL upload/relationship fields; this reproduction uses a plain textarea on MongoDB.

Which area(s) are affected?

area: ui, area: core, db: mongodb

Environment Info

payload / @payloadcms/ui / @payloadcms/db-mongodb: 3.90.1
Next.js: 16.3.6
Node.js: 24.19.0 (isolated Local API reproduction: 24.15.0)
macOS, arm64

Activity

  1. keerthana9944 commented on Oct 13, 2026

    @keerthana9944

    Hi! I’d like to contribute a fix for this issue. I’ll investigate the root cause and work on a solution with a regression test to prevent the issue from recurring.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions