Hello, Prismic community!
Is there a way to disable the editing feature on fields(slug or UID in this case) after the document is published?
We are experiencing the issue that UIDs get updated on published documents without putting the correct redirect in place. And this results in the creation of the same page with different UID. It would be great to have an option to make the UID field non-editable(or disabled) after the document is published.
Looks like there was a request for the same or similar feature a while back:
Can I disable or hide a field that content editors should no longer use?
Has this feature been added by any chance? Or any plans to add?
This is not something that exists within Prismic and is not something that we are likely to implement. Although I've marked it as a feature request for the team to see.
The issue with disabling UID editing after publishing is that users will no longer be able to update this important field in the case of errors or changes, so it would be counterproductive.
A better solution might be a more robust publishing workflow with our user roles. This way Publishers can make sure Writers haven't edited this field.
I would like to understand your website application a bit better though to know why changing a UID causes multiple builds of the same page. What technology is you app built in?
We have also discussed showing old UIDs in an object in the API to build redirects easier for static websites and also gave an automatic workaround for re-redirecting from changed UIDs here:
@sebastien.vassaux & @bart ,
I talked with Levi here in the team and he created a workaround for this when building our documentation website that re-directs to the correct page when you use the old UID. It basically involves running the query live if the UID is not in the static list, it searches the API and returns the document with the old UID. If the UID doesn't exist anywhere the standard 404 is returned.
This example is in Next.js and using the REST API but the logic should w…
This is being tracked as an open feature request.
If you have another use-case for this feature, you can
'Flag' this topic to reopen. Please use the button to show your support for the feature and check out our Feature Request Guidelines.