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

Cannot Save component even if the fields are unique. #17604

Closed
vaidikMirae opened this issue Aug 8, 2023 · 3 comments
Closed

Cannot Save component even if the fields are unique. #17604

vaidikMirae opened this issue Aug 8, 2023 · 3 comments
Assignees
Labels
fix:5 Fixed in Strapi 5 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 source: core:strapi Source is core/strapi package status: pending reproduction Waiting for free time to reproduce the issue, or more information

Comments

@vaidikMirae
Copy link

Bug report

Required System information

  • Node.js version: 18.12
  • NPM version: 9.6
  • Strapi version: v4.12.1
  • Database: Postgresql
  • Operating system: Linux
  • Is your project Javascript or Typescript: Javascript

Describe the bug

When I try to save the single content type, which has a links component with a unique field that throws an error anytime I try to save the content, it throws an error even if I provide the unique content.

Steps to reproduce the behavior

  1. Go to single type content
  2. Create a component with a unique field inside it.
  3. Fill the content in single type
  4. Try to save the content.

Expected behavior

Save the single type content with the unique fields inside it.

Screenshots

image

@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:strapi Source is core/strapi package source: core:content-manager Source is core/content-manager package status: pending reproduction Waiting for free time to reproduce the issue, or more information labels Aug 15, 2023
@marcodeluca
Copy link

marcodeluca commented Nov 8, 2023

Question/concern about this issue not being a critical severity and seems to be stale last reviewed in August. Being able to have unique fields in a component is an important business requirement for most people?

@pjr94
Copy link

pjr94 commented Jan 29, 2024

I have also experienced this issue. I have a ParticipantID field which relates to an ID provided by an external system, so I cannot simply change the ID in order to save the Entry as it would be desynced with the external system. I've not run into the issue yet, but if the client asks me to update some data in the collection (eg phone number or whatever), I will not be able to do this without changing the ParticipantID, which would be a big problem and break the relationship with the external system unless they can update it there too. Either way, its a bad work around and unproffessional.

TL:DR Yes it is very important to fix this for business reasons!

The Issue:
I think the issue is more than the unique field is comparing its new content with the existing old content and recognising it as not unique.

Solution: There needs to be an exemption that unique fields can be the same in the same when it relates to the same Entry, so you can edit the Entry without changing the unique field.

@jhoward1994 jhoward1994 added the fix:5 Fixed in Strapi 5 label Jun 20, 2024
@jhoward1994
Copy link
Contributor

This issue has been fixed in v5 from 5.0.0-beta.13 onwards via #20427

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix:5 Fixed in Strapi 5 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 source: core:strapi Source is core/strapi package status: pending reproduction Waiting for free time to reproduce the issue, or more information
Projects
Status: Fixed/Shipped
Status: Done
Development

No branches or pull requests

6 participants