Problem/Motivation

Discovered by @xjm in #2862041-175: Provide useful Views filters for Content Moderation State fields. Quoting the steps to reproduce:

- Add Editorial to articles.
- Edit the frontpage view. Add a moderation state filter. You'll see Draft, Published, Archive as allowed values. Select Archive and save. (Let's say archive is a published state.).
- Add a new workflow called Albatross with "Bird" and "Mariner" states. Attach it to pages.
- Edit the frontpage view. Edit the moderation state filter. You'll see Draft, Published, Archive, Bird, Mariner as allowed values.
- Remove the Editorial workflow from articles. Back to the view. Your only options are Bird and Mariner. Until you actually save this filter, though, your view still has Archive stored in the config. When you save it, though, it's impossible to save Archive to the config anymore.

Proposed resolution

Disallow removing moderation for a bundle that has moderated content.

Remaining tasks

- code this in \Drupal\content_moderation\EventSubscriber\ConfigImportSubscriber too
- add tests

User interface changes

Yes, a bundle that has moderated content can not be removed from a workflow.

API changes

Same as the UI changes but on config sync.

Data model changes

Nope.

CommentFileSizeAuthor
#2 2907449.patch7.82 KBamateescu

Comments

amateescu created an issue. See original summary.

amateescu’s picture

Status: Active » Needs review
Issue tags: +Needs tests
StatusFileSize
new7.82 KB

This fixes the problem on the UI side.

sam152’s picture

Are we confident there are other more fundamental issues with disabling moderation on a bundle that has already been moderated? I don't think the views issue is compelling enough by itself (although I'm yet to get in there and do some proper testing), so if we can justify the extra complexity with a scarier scenario, I think that might help.

NW, because for the other integrity related methods, we also enforce this during config validation. Also likely to heavily conflict with #2897148: Remove @internal from workflowHasData/workflowStateHasData and use those methods for access control and configuration validation..

amateescu’s picture

Not sure about other fundamental issues, I'll get back to this question tomorrow.

NW, because for the other integrity related methods, we also enforce this during config validation.

Yep, that's already mentioned in the issue summary :)

Also likely to heavily conflict with #2897148: Remove @internal from workflowHasData/workflowStateHasData and use those methods for access control and configuration validation..

Why does it conflict with that patch, we're just adding a new method to \Drupal\content_moderation\Plugin\WorkflowType\ContentModerationInterface here.

sam152’s picture

Yep, that's already mentioned in the issue summary :)

My mistake! So it is. It will conflict because we're essentially making the config import validation stuff part of the actual @WorklfowType plugin API, so we'll need to move the subscriber.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.0-alpha1 will be released the week of January 17, 2018, which means new developments and disruptive changes should now be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

sam152’s picture

Status: Needs work » Closed (won't fix)

If I can summarise a year old conversation, disabling moderation on a bundle with moderated content results in a views usability WTF, but not much else.

If this is the only issue, I think we should close this because not allowing the user to disable moderation is a usability WTF in itself and this feels like the kind of change which could regularly cause grief to users, whereas the views issue is pretty innocuous.