v4 localizeStatus: unpublishing one locale validates its content, so an invalid published locale can be neither republished nor unpublished

Open
#19,658 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@pardeepsinghverma is already working on this.

Since Nov 17, 2026.

  • #19668 by @pardeepsinghverma — open
  • #19688 by @pcbeingused333 — open

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
postgresql, typescript

Research direction

Start with updateDocument and shouldLimitValidationToSubmittedFields in collections/operations/utilities/update.ts, then trace the locale unpublish request described in the issue. Use the linked repro-4.ts reproduction to confirm that unpublishing fr fails on the invalid localized field; done means unpublishing succeeds without validating that locale's content.

Written by the indexing model from the issue text.

Description

area: core (versions / localization) area: ui (Unpublish in locale) Bug Payload OSS
Describe the Bug

With versions.drafts.localizeStatus, a published locale can become invalid without anyone editing it, and then it can be neither republished nor unpublished, through the API or the admin.

  1. A collection has a non-localized array whose items have a required localized field.
  2. Publish en and fr.
  3. Add an item and publish en only. fr stays published, but the new item has no fr value. Nothing validates fr at this point (that may be intended).
  4. Republishing fr fails validation, which is expected.
  5. Unpublishing fr also fails validation.
    • The admin's "Unpublish in French" (UnpublishButton) sends PATCH /api/pages/:id?locale=fr with { _status: 'draft' }.
    • updateDocument validates the locale's whole content for that request.
    • Only unpublishAllLocales limits validation to the submitted fields (shouldLimitValidationToSubmittedFields in collections/operations/utilities/update.ts).

So the only way to take the broken locale offline is to edit the database.

Expected: unpublishing a locale does not validate its content, as with unpublishAllLocales. It would also help if publishing one locale warned that other published locales are now invalid.

Link to the code that reproduces this issue

https://github.com/elghaied/payload-v4-reproductions (repro-4.ts)

Reproduction Steps
  1. pnpm install, then cp .env.example .env and point DATABASE_URL at an empty PostgreSQL database
  2. pnpm repro repro-4.ts

Output:

(a) fr published read: ["A-fr","B"] fr _status: published
(b) republish fr FAILED: The following field is invalid: Items 2 > Label
(b) unpublish fr FAILED: The following field is invalid: Items 2 > Label

("B" is the en fallback; the fr value is empty.)

Which area(s) are affected?

area: core (versions / localization), area: ui (Unpublish in locale)

Environment Info
payload: 4.0.0-beta.9
@payloadcms/db-postgres: 4.0.0-beta.9
Node.js: 24.22.1
PostgreSQL: 17.10
(local API only, no Next.js app)
Dominant language
TypeScript
Stars
45.8k
Forks
4.4k
Avg merge
2d 16h
Merged PRs (30d)
251

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from payloadcms/payload

All issues in payloadcms/payload

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.