Unable to save document

Hello,

I'm unable to save my document after creating a translated version:

By the way, I wonder how I can associate a document in one locale with its equivalent in another locale?

Thanks a lot for your help,

David

Hi @dgourdet,

What's happening here is a UID conflict. You must have a document in the target locale that already has had this UID in the past.

Let me clarify how UIDs work and how to manage them:

Each document in Prismic saves its history of UIDs. If a document once had the uid "21," it retains that uid until the document is deleted. UIDs are preserved in the history of document to prevent URLs from breaking. UIDs can be shared between different custom types. For example, a "page" type and a "book" type can both have a document with the uid example-uid. Translations of the same document can share the same uid since they are considered the same document in different languages.

Steps to Reuse a UID:

  1. Find the Document: Use your API browser to search for the document with the old UID. Replace your-repo-name with your repository name: prismic.io - API Browser
  2. Enter the following query (replace your-page-type with your Page Type API ID): [at(my.your-page-type.uid, "old-uid")]
  3. Duplicate the Document: Once you find the document with the old UID, duplicate it by going to the edit page and clicking the Duplicate button.
  4. Delete the Original Document: After duplicating, delete the original document with the old uid. This will free up the uid for reuse.

I hope this helps! If you need further assistance, please don’t hesitate to ask.

1 Like

Thanks @Ezekiel,
it's very clear :)

1 Like