Skip to content

Unpublishing documents with required localized fields fails with validation error #15651

@marcusforsberg

Description

@marcusforsberg

Describe the Bug

When using the Unpublish button on a document that contains at least one field that has both required: true and localized: true, a validation error is thrown saying that the required field is invalid, and the unpublish action fails.

This effectively means it's impossible to unpublish a document with localized and required fields without deleting it entirely.

Link to the code that reproduces this issue

https://github.com/marcusforsberg/payload-unpublish-localized-fields-error

Reproduction Steps

  1. Clone the reproduction repo and setup a database (I have only tested this using Postgres)
  2. Create and publish a document in the Test collection with any title in any locale.
  3. Click the Unpublish button
  4. Unpublishing fails with error The following field is invalid: Title, even though a title is set on the published version:
Screen.Recording.2026-02-17.at.15.26.46.mov

FWIW, I have not enabled the experimental localizeStatus flag and I'm running with localization.fallback: false in payload.config.ts.

// payload.config.ts
localization: {
    locales: ['en', 'sv'],
    defaultLocale: 'en',
    fallback: false,
},
// Test.ts
export const Test: CollectionConfig = {
  slug: 'test',
  admin: {
    useAsTitle: 'title',
  },
  fields: [
    {
      name: 'title',
      type: 'text',
      required: true,
      localized: true,
    },
  ],
  versions: {
    drafts: true,
  },
}

The linked reproduction is based on the blank template and I've only enabled localization and added a test collection with a single field to showcase the error. See this commit: marcusforsberg/payload-unpublish-localized-fields-error@ce32f5c

The issue appears to happen regardless of field type and also happens on fields that aren't useAsTitle.

Reverting back to v3.71.1 fixes the issue, so I believe this was introduced in v.3.72.0 through #14667.

Edit 16/3: I updated the repro to v3.79.1 in the hopes that #15932 would fix this, but unfortunately it appears as though the bug still remains.

Which area(s) are affected?

area: core

Environment Info

Binaries:
  Node: 24.13.0
  npm: 11.6.2
  Yarn: N/A
  pnpm: 10.19.0
Relevant Packages:
  payload: 3.76.1
  next: 15.4.11
  @payloadcms/db-postgres: 3.76.1
  @payloadcms/drizzle: 3.76.1
  @payloadcms/graphql: 3.76.1
  @payloadcms/next/utilities: 3.76.1
  @payloadcms/richtext-lexical: 3.76.1
  @payloadcms/translations: 3.76.1
  @payloadcms/ui/shared: 3.76.1
  react: 19.2.1
  react-dom: 19.2.1
Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 23.6.0: Mon Jul 29 21:14:46 PDT 2024; root:xnu-10063.141.2~1/RELEASE_ARM64_T6031
  Available memory (MB): 36864
  Available CPU cores: 14

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