0

I'm having troubles enabling Content Moderation Module (content_moderation) on a Drupal 8.7.8 site.

During installation everything seems fine, drush en content_moderation finishes without errors, workflows module is already enabled before.

After install the editorial workflow is missing, but it's possible to create a new content moderation workflow.

All role permissions are available and the Moderation State widget shows up on nodes of the selected types. But using the widget has no effect, nodes don't get published or unpublished.

The database tables for Content Moderation are created properly (ie. content_moderation_state and three more with similar names).

Also the view moderated_content shows "Broken/missing handler" where the filter criteria "Content revision: Moderation state (exposed)" and "Content revision: Moderation state (<> Published)" are supposed to be.

Clicking the Broken/missing handler fields shows some details for the two broken handlers:

The handler for this item is broken or missing. The following details are available:
id: moderation_state_1
table: node_field_revision
field: moderation_state
relationship: none
group_type: group
admin_label:
operator: not in
group: 1
exposed:
is_grouped:
entity_type: node
plugin_id: moderation_state_filter
Enabling the appropriate module may solve this issue. Otherwise, check to see if there is a module update available.

Second field shows this info:

id: moderation_state
table: node_field_revision
field: moderation_state
relationship: none
group_type: group
admin_label:
operator: in
group: 1
exposed: 1
is_grouped:
entity_type: node
plugin_id: moderation_state_filter

I also can't add any moderation state related fields to the view like "Moderation state". The fields do not show up in the "Add fields" dialog.

I'm having no problems setting up Content Moderation on a vanilla Drupal 8.7.8 it just fails on this existing site (same version).

I already tried reverting the site and reinstalling workflows and content_moderation on different ways, with drush and manually. I uninstalled all custom modules and patches and reinstalled content_moderation.

Are there any modules (except workbench) or settings known to cause problems with Content Moderation?

Any ideas what could be causing the problem or where to start looking?

Thanks a lot!

0

The guys over at Drupal's Slack channel pointed me in the right direction. I added detailed troubleshooting infos to the Content Moderation Guide.

If you enable Content Moderation (drush en content_moderation) on a site, that was not installed using Drupal's Standard Profile as a base, you will run into some problems which require a few manual steps before you can use Content Moderation, as detailed in the guide.

Fix missing Editorial workflow

If the Editorial workflow was not created when enabling Content Moderation, you can either manually create a new workflow and assign a content type, that's used with your new workflow or import the Editorial workflow manually.

The template for the Editorial Workflow is:

langcode: en
status: true
dependencies:
  module:
    - content_moderation
id: editorial
label: Editorial
type: content_moderation
type_settings:
  states:
    archived:
      label: Archived
      weight: 5
      published: false
      default_revision: true
    draft:
      label: Draft
      published: false
      default_revision: false
      weight: -5
    published:
      label: Published
      published: true
      default_revision: true
      weight: 0
  transitions:
    archive:
      label: Archive
      from:
        - published
      to: archived
      weight: 2
    archived_draft:
      label: 'Restore to Draft'
      from:
        - archived
      to: draft
      weight: 3
    archived_published:
      label: Restore
      from:
        - archived
      to: published
      weight: 4
    create_new_draft:
      label: 'Create New Draft'
      to: draft
      weight: 0
      from:
        - draft
        - published
    publish:
      label: Publish
      to: published
      weight: 1
      from:
        - draft
        - published
  entity_types:
    node: null
  default_moderation_state: draft

Copy the template to some yml file and import it using drush config:import --partial.

Fix Broken/missing handler on the Moderated Content view

This error occurs, if there exists no moderation workflow that is assigned to a content type. Wether you just imported the Editorial workflow as described above or created a custom moderation workflow, you'll have to make sure it has at least one content-type assigned to it. Just edit your moderation workflow, scroll to the bottom of the page and select at least one content type that is used with this workflow. After you save your changes, the "Broken/missing handler" on the Moderated Content will be gone and the view at /admin/content/moderated will work as expected.

| 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.