-1

I am building Views with a field to display the entity's content_moderation_state. For FieldFormatter, I select 'Content moderation state', which is the ContentModerationStateFormatter defined within Content Moderation module. On executing the view, I see that the field content is not so formatted. The machine name, not the label is displayed.
In fact, when debugging, I find that we do not even hit the ContentModerationStateFormatter! Views is displaying the machine name and disregarding the request to format.

Has anyone else had this problem or have a solution? Many Thanks.

1

Please note, that the content moderation module is still in Beta as for the current stable Drupal core. You should always check the Drupal issue queue for issues with it.

If you are on Drupal 8.4.4, there is still an issue with the moderation state formatter, which has been fixed for 8.5: https://www.drupal.org/project/drupal/issues/2859381 Applying these fixes to Drupal 8.4.4 made it work for us.

If you are on a Drupal version before 8.4, you may even have to migrate the workflows to 8.4 first, as there have been some breaking changes to the workflows module while maturing to stable.

  • Thank you, Mario; yes I am on 8.4.4. My content_moderation states show in a view by using a relationship to Content Moderation state. For a short term solution, I will sanitize the string to get "In progress" instead of "in_progress". Look forward to 8.5, tho! – MEI Jan 12 '18 at 23:28

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.