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

Unique field option cannot be enabled if localization is disabled #22475

Open
derrickmehaffy opened this issue Dec 18, 2024 · 0 comments
Open
Labels
flag: EE Issues correlates to internal EE ticket issue: bug Issue reporting a bug severity: high If it breaks the basic use of the product source: core:content-type-builder Source is core/content-type-builder package status: confirmed Confirmed by a Strapi Team member or multiple community members version: 5

Comments

@derrickmehaffy
Copy link
Member

Bug report

Required System information

  • Node.js version: v20
  • NPM version: v10
  • Strapi version: 4.6.0
  • Database: SQLite 3
  • Operating system: Linux Mint 22.0
  • Is your project Javascript or Typescript: Javascript

Describe the bug

When adding a field if you do not want to enable localization (sync value across locales) but want unique enabled the content-type builder forces you to use localization with unique even though if you manually change the schema and test with data Strapi functions just fine with unique non-localized entries.

Steps to reproduce the behavior

  1. Create a content-type with i18n turned on
  2. Try to add a field
  3. Disable localization
  4. Try to enable unique
  5. See error

Expected behavior

To confirm with product team, but we should be able to have unique without localization as unique is applied at the document level not the entry level

Screenshots

image

Code snippets

As a workaround you can manually disable localization after creating the field:

"uniqueString": {
      "pluginOptions": {
        "i18n": {
          "localized": false
        }
      },
      "type": "string",
      "unique": true
    }

Additional context

Possible related issue/discussion about what we intend: #20909

Related to Internal TID9193

@derrickmehaffy derrickmehaffy added issue: bug Issue reporting a bug severity: high If it breaks the basic use of the product status: confirmed Confirmed by a Strapi Team member or multiple community members source: core:content-type-builder Source is core/content-type-builder package flag: EE Issues correlates to internal EE ticket version: 5 labels Dec 18, 2024
@github-project-automation github-project-automation bot moved this to To be reviewed (Open) in Developer Experience Squad Dec 18, 2024
@derrickmehaffy derrickmehaffy moved this from To triage to Backlog in Strapi 5 - Bug Tracker Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flag: EE Issues correlates to internal EE ticket issue: bug Issue reporting a bug severity: high If it breaks the basic use of the product source: core:content-type-builder Source is core/content-type-builder package status: confirmed Confirmed by a Strapi Team member or multiple community members version: 5
Projects
Status: To be reviewed (Open)
Status: Backlog
Development

No branches or pull requests

1 participant