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

[Strapi v5 RC] Unique Slug UID Field Allows Duplicate Slugs Across Different Locales #20909

Open
burakozdemir32 opened this issue Jul 31, 2024 · 2 comments
Assignees
Labels
issue: bug Issue reporting a bug issue: discussion A general discussion issue severity: medium If it breaks the basic use of the product but can be worked around source: core:content-manager Source is core/content-manager package status: confirmed Confirmed by a Strapi Team member or multiple community members version: 5

Comments

@burakozdemir32
Copy link

Bug report

Required System information

  • Node.js version: 18.17.0
  • NPM version: yarn/1.22.19
  • Strapi version: 5.0.0-rc.7
  • Database: sqlite
  • Operating system: darwin-arm64
  • Project type: Typescript

Describe the bug

The unique slug uid field does not enforce uniqueness across different locales. Normally, creating a new entry with the same slug should not be allowed, but it currently permits creating entries with duplicate slugs if they are in different languages.

Further improvement suggestion:

To enhance the user experience and data integrity, it would be beneficial to enforce the uniqueness of the slug uid field across all locales. This ensures that each slug remains unique globally, regardless of the language.

Steps to reproduce the behavior

  1. Enable localisation for a collection type.
  2. Add a unique slug uid field to the collection type.
  3. Create a new entry in English with a specific slug.
  4. Create another entry in a different language with the same slug.

Expected behavior

The application should not allow the creation of a new entry with the same slug, even if the entries are in different languages. The slug should remain unique across all locales to prevent any potential conflicts or confusion.

Screenshots

N/A

Code snippets

N/A

Additional context

N/A

@derrickmehaffy derrickmehaffy added issue: bug Issue reporting a bug severity: medium If it breaks the basic use of the product but can be worked around source: core:content-manager Source is core/content-manager package status: pending reproduction Waiting for free time to reproduce the issue, or more information version: 5 labels Aug 15, 2024
@github-project-automation github-project-automation bot moved this to To be reviewed in Content Squad v4 Aug 15, 2024
@derrickmehaffy derrickmehaffy added issue: discussion A general discussion issue status: confirmed Confirmed by a Strapi Team member or multiple community members and removed status: pending reproduction Waiting for free time to reproduce the issue, or more information labels Aug 28, 2024
@derrickmehaffy derrickmehaffy moved this from To triage to Backlog in Strapi 5 - Bug Tracker Aug 28, 2024
@derrickmehaffy
Copy link
Member

I was able to confirm this however I believe the logic is intended as we have had this as a feature request for a while.

The UID fields are unique between documents but not between entries of the document (thus multiple drafts/published or locales can have the same UID.

This logic needs to be confirmed by engineering, if it's intended then we can just close this bug.

@reslear
Copy link

reslear commented Oct 18, 2024

Also hi @derrickmehaffy @oiorain any news?

What if you put it in manually, I won't break anything? :)

      “pluginOptions": {
        { “i18n”: {
          “localized": false
        }
      },

it needs to be both 2 cases:

  • different slug for different languages (current solution)
  • the same slug for those who need it (need work on validator between switch langs )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue: bug Issue reporting a bug issue: discussion A general discussion issue severity: medium If it breaks the basic use of the product but can be worked around source: core:content-manager Source is core/content-manager package status: confirmed Confirmed by a Strapi Team member or multiple community members version: 5
Projects
Status: Backlog
Development

No branches or pull requests

4 participants