We have a D8 core Content Moderation workflow. When attempting to move content to a published state while looking inside the edit form, this module works as expected, but when changing moderation state from the node preview form (which is a node update), this doesn't happen. I suspect this is related to https://www.drupal.org/project/require_on_publish/issues/2979560, but given that issue, that content moderation is likely to take place in that preview page, I would request that this functionality is made available.

I think the Content Moderation scenario is easier than the Scheduler scenario in that you can throw messages to the user at the time they want to approve something. I'd love to see this either enabled for Content Moderation on update or have this as a setting users can opt to toggle on for these tricker edge cases.

Comments

Snugug created an issue. See original summary.

mpriscella’s picture

Have you taken a look at #2849279: Make the moderation control form an entity form so that it validates entities before save? It looks like this might be what you're looking for, but if I'm incorrect please let me know! In any case, I'll be looking into the content_moderation later tonight to see how they're handling validation.

Snugug’s picture

That issue may be what I'm looking for! I'll take a look at that, too.

As an aside, thank you so much for this module, it's a sorely lacking piece of functionality in Drupal

mpriscella’s picture

Thank you! Let me know if the above issue works for you, then we can close this issue out.

Snugug’s picture

I can't get the patch applied (my codebase is on 8.5, this appears to be against 8.6), so I can't test to see if it works :\

Snugug’s picture

Ok! So, I've got the patch applied but it doesn't appear to be validating this when changing content moderation state

mpriscella’s picture

Ah, damn! I'll spin up a test environment and do some investigation.

Snugug’s picture

Thank you!

Snugug’s picture

Take a look at the comments from last week; in the issue queue for the linked issue they're recommending that the validation constraints for this module are added to the entity itself, as opposed to the entity field, as by design Drupal won't fail on validation for fields that aren't visible.

mpriscella’s picture

Sweet, thanks! Will attempt adding the constraints to the entity itself tomorrow pm.

mpriscella’s picture

@Snugug Added the constraint to the entity itself and everything seems to be in working order, but if you could test the patch with your workflow that would be much appreciated!

Snugug’s picture

StatusFileSize
new38.46 KB

HUZZAH! With the patch from https://www.drupal.org/project/require_on_publish/issues/2986442#comment... applied, and the latest patch from https://www.drupal.org/project/drupal/issues/2849279#comment-12718501 applied, this all appears to be working!

Working "Required to Publish" error message

mpriscella’s picture

Great!! I'll merge this in today and create a new release! Thanks for your help testing this out!!

  • mpriscella committed 9d5c430 on 8.x-1.x
    Issue #2986442 by mpriscella, Snugug: Validate on Content Moderation...
mpriscella’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

_kash_’s picture

This seems to be not working again. I posted a comment about it with a patch here https://www.drupal.org/project/require_on_publish/issues/3282077#comment...