Skip to content

No validation error raised when publishing a document with missing localized fields #13387

@sacha-c

Description

@sacha-c

Describe the Bug

Given a document with required localized fields that are incomplete in locale fr
When clicking the general "Publish" button on locale en where everything is complete
Then the document is marked as "Published" anyway although validation would not pass on the incomplete locale.

This seems to happen because validation is only run on the currently selected locale.

What I expect to happen:

  • The general "Publish" button should throw a validation error if not all locales pass validation
  • The specific "Publish in en" should work if that specific locale passes validation

Additionally I think this issue #4194 mentions confusions with how this publish individual locales buttons work, which I do agree with. Currently I think it is a little error-prone and difficult to understand as a CMS user what happens when clicking publish, especially with this bug.

Link to the code that reproduces this issue

https://github.com/sacha-c/payload/tree/reproduction/localization-draft-validation

Reproduction Steps

  1. Create a new Post
  2. Switch to locale fr
  3. Fill in the Title with a value
  4. Click on Publish
  5. See that the document is marked as Published
  6. Switch to locale en
  7. See that the document is marked as Published, but the Title is missing ⚠️

Which area(s) are affected? (Select all that apply)

area: core

Environment Info

payload: 3.50.0
node.js: v23.11.0
next.js: 15.4.4

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions