Closed cornernote closed 7 years ago
Hi @cornernote,
as you have understood, the WorkflowValidator
validator only perform validation on status change and right now, only a custom validator could do what you describe
Can we add another state that checks the current status instead of a transition?
yes that's an option. Another option could be to create a reflexive transition from {post/published} ot itself. This way, when the model is saved and the status does not change, yii2-workflow will assume it is dealing this transition and perform configured validation.
That could work ....
When I change to
status=published
I requirepublished_date
.However once it's in published, there is no validation unless the status changes again.
It would be nice if I could say
published_date
was required ifstatus=published
(or if the status is in a given list). Is there any easy way to do this without making a custom validator?