1

Client has a custom Craft plugin for managing their bespoke publication workflow on a large website. Content creators create new or updated content that is saved as drafts, then inspected and approved by editors before publication.

This plugin makes heavy use of the EntryRevisions Service Which has been deprecated in CraftCMS 3.2. For example, the plugin often fetches a draft instance by ID before performing other actions (publish/edit/delete), using information in the draft to create a notification email, or getting the contents of the draft for review. The plugin has it's own tables the track drafts by it's ID alone, so it's my primary means of looking up drafts.

The API documentation says to use the EntryQuery API instead, but the docs don't mention how to get a draft or revision.

Does anyone know how drafts are fetched and worked with going forward?

1

Revisions and Drafts are first-class citizens of the Element world in Craft 3.2.

So for your example:

The plugin has it's own tables the track drafts by it's ID alone, so it's my primary means of looking up drafts.

This is what you would do:

$draft = Entry::find()
    ->draftId(123)
    ->one();
|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.