Studio

Document actions

Unpublish document action moved, Improvements, and bugfixes

v4.6.1

✨ Highlights

Unpublish from the Published perspective

The Unpublish document action has been relocated within Sanity Studio for improved workflow clarity.

  • Previous behavior: Unpublish action was available from draft perspective
  • New behavior: Unpublish action is now only available from the published perspective

Impact:

To unpublish a document, editors must now:

  • Select the published perspective (on the Studio or document header level)
  • Access the unpublish action from the actions document footer
a computer screen shows a published draft and a new release
how to switch to the published perspective from both the Studio and document header

This change ensures editors are working with the published version when making unpublish decisions, providing better context and reducing potential confusion between draft and published states.

Presentation tool update

In Presentation Tool, origin is now always included in the Main Document Resolver context object (DocumentResolverContext). Previously it would be undefined for relative URLs.

🐛 Notable bugfixes

  • Fixes an issue that could in some cases leave the document stuck in "Saving" state after a connection loss.
  • Fixes an issue that in rare cases could cause the publish action to get stuck in "Publishing" state.
  • When discarding a version from the release detail, the preview will now be the correct one.
  • Fixes issue preventing custom asset source being used if directUploads is set to false.
  • Fixes an issue causing the unpublish action to be shown erroneously for nonexistent drafts.

Install or upgrade Sanity Studio

To initiate a new Sanity Studio project or upgrade an existing one, please refer to our comprehensive guide on Installing and Upgrading Sanity Studio.

If you are updating from a version earlier than 3.37.0, you should also check out this article to ensure your dependencies are up to date.

Modify documents when duplicating; Duplicate Releases; and fixes for unpublishing documents in structure form

v3.91.0

New Features

Modify a document through a duplication action

Sometimes you want to omit certain fields or add certain information when duplicating documents. It's now possible to programmatically modify the created document when duplicating a document. This can be achieved by setting the mapDocument option when executing the duplicate document operation, or by passing a prop of the same name (mapDocument) to the system duplicate document action component.

mapDocument is a function that receives the duplicated document as its only parameter, and should return a new object representing the duplicated document that will be created.

Here's an example demonstrating how a custom duplicate document action could be used to omit a field (slug) from the duplicated document:

Duplicate a Content Release

This is a paid feature

This feature is available as an addon for certain Enterprise plans. Talk to sales to learn more.

Sometimes you want to work iteratively on a Content Release and stage changes to the same set of documents. You can now duplicate a release from the overview page by clicking on the '...' button and select 'Duplicate release'.

This will create a new release copying the original release's title, description, release type and publish date. New versions of all documents in the original release will also be created.

Duplicating a locked and scheduled release will create a new active release, which can be rescheduled.

Manage Workspace Content Releases limit

The new releases.limit configuration option can be used to prevent Studio users creating releases if the number of active releases in the dataset has reached the configured limit. This is a purely client-side guard intended to help control release usage across an organisation.

🐛 Notable bugfixes

  • Fixes issue where a document location resolver state was incorrectly duplicated across multiple Presentation instances.
  • Fix for an issue where documents marked as to be unpublished in a release show an empty document form title preview. Now the document form will show the current title of that document.
  • Fixes an issue in where users with no dataset read permissions were seeing an error toast on load.
  • Fixes an issue in where the studio dev command will get blocked if using auto update in a non interactive environment.