Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicating documents with required, localized text fields fails with a "ValidationError: The following fields are invalid" message #4232

Closed
peterskeide opened this issue Nov 21, 2023 · 1 comment · Fixed by #4236
Assignees
Labels
status: needs-triage Possible bug which hasn't been reproduced yet

Comments

@peterskeide
Copy link

Link to reproduction

No response

Describe the Bug

Hi,

Currently it is possible to create a document with a required and localized field, without adding a translation for every supported language. However, I get an error message whenever I try to duplicate an existing document with this kind of field. Duplicating a non-localized, required field works as expected. Duplicating a localized, optional field also works.

An example error message from one of my collections with a "title" field: ValidationError: The following fields are invalid: title.

This behavior is problematic, as we have quite a lot of localized content, and currently duplication doesn't work for any of it.
The expected behavior is that duplication only validates the currently used locale, like when creating a new document.

To Reproduce

  1. Enable localization
  2. Add this field to a collection:
    {
      name: 'title',
      type: 'text',
      required: true,
      localized: true
    }
  3. Create a new document
  4. Duplicate the new document

Payload Version

2.1.0

Adapters and Plugins

db-mongodb, bundler-webpack

@peterskeide peterskeide added the status: needs-triage Possible bug which hasn't been reproduced yet label Nov 21, 2023
@peterskeide peterskeide changed the title Duplicating a required, localized text field fails with a "ValidationError: The following fields are invalid" message Duplicating documents with required, localized text fields fails with a "ValidationError: The following fields are invalid" message Nov 21, 2023
@DanRibbens DanRibbens self-assigned this Nov 21, 2023
Copy link

github-actions bot commented Sep 7, 2024

This issue has been automatically locked.
Please open a new issue if this issue persists with any additional detail.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: needs-triage Possible bug which hasn't been reproduced yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants