- π¬π§United Kingdom AaronMcHale Edinburgh, Scotland
We have a requirement for this, where we have a "Ready to publish" state, just before publish, and so it would be great to be able to select the transition that the check should be done on.
- π¬π§United Kingdom AaronMcHale Edinburgh, Scotland
Thinking about this more, I think what would work well is to add a checkbox to the workflow transition form which allows setting whether content should be required on transitioning to this stage, something like:
Label: Enable require on publish checks for this transition
Description: When enabled, content passing through this transition will have the require on publish validation performed for any fields which have the "Require on publish" option enabled.That then gives us the flexibility to have the check performed at multiple transitions, which I think is more robust.
For example, enabling this for both "Ready to publish" and "Published" would mean that even if content is edited after it has transitioned to the ready to publish state, the validation should still be performed.
- πΊπΈUnited States jcandan
Any chance β¨ Add require on publish as a conditional field option Active fixes this? I haven't tested, but since it adopts
#states
condition handling, that might address this issue. - πΊπΈUnited States jcandan
Ya know! Actually, I missed this ticket when I created π Fix Paragraphs support with Content Moderation Active . Please take a moment to review the patch/MR there. Sorry if this ended up being a duplicate ticket!
- πΊπΈUnited States jcandan
By the way, just to clarify why I think β¨ Add require on publish as a conditional field option Active may be related is that it introduces state handling for conditions (e.g. when some other field is check, make this one required on publish).
Though it may seem π Fix Paragraphs support with Content Moderation Active has more to do with this module's Paragraphs support, it adds support for moderation states that are considered Published.
I don't think we had this before.
$workflow = $this->moderationInfo->getWorkflowForEntity($parent); $new_state = $workflow?->getTypePlugin()->getState($moderation_state[0]['state']); if ($new_state) { $is_published = $new_state->isPublishedState(); }
I don't think that fully encompasses this issue's desired outcome, but it may be a step in the right direction.
- π¬π§United Kingdom AaronMcHale Edinburgh, Scotland
β¨ Add require on publish as a conditional field option Active sounds like a really good idea! Maybe we block this issue on that one? Because once that's in then I'm assuming this becomes a lot easier and can then just focus on adding a UI for this common use-case.
- πΊπΈUnited States jcandan
Actually, I just thought of a use-case for us where this would come in handy. And, not only does that #states ticket get us part of the way there, π content_moderation support Needs work introduces content moderation published states as well. And, yes, from there, I agree, some logic and a UI to handle state selection would get us the rest of the way. Looking forward to this.
Postponed until the above are adopted.