Duplicate record not working in production mode

System Information
  • Strapi Version: 4.12.1
  • Operating System: MacOS
  • Database: MySQL
  • Node Version: 18
  • NPM Version: 8
  • Yarn Version: 1.22

after the last upgrade to Strapi v.4.12.1 the duplication functionality from the record list is broken.
The response I get from the API is:

    "data": null,
    "error": {
        "status": 400,
        "name": "ApplicationError",
        "message": "Entity could not be cloned as it has unique and/or relational fields. Please edit those fields manually and save to complete the cloning.",
        "details": {}

I am not sure if this error is a Strapi issue or my collection cannot be duplicated.
What can cause this error since the message is not clear? Also, this error appears for collections that don’t have relations at all.

Hi @bledar
We are also having the same issue. It happens also on v4.12.5. Have you had luck with this?

@bbonfim unitl now I haven’t found any solution about this. Seems the Strapi team has changed the validation rules about cloning.
The problem seems to be the unique fields (slug in my case).

@bledar for us I think is the relation. We use a dynamic zone with lots of “components” using relation. We thought about a work-around using the read/create rest APIs. Basically taking the read response and pushing it to the create API (after cleaning up IDs). Duplicating records is something we use a lot since our pages are rather long. I will post the work-around once we have time to work on it.