Fix trash error when workflow status is draft

[MAILPOET-4792]
This commit is contained in:
Jan Jakes
2022-11-09 13:51:45 +03:00
committed by Jan Jakeš
parent 78f10f064e
commit bda979ec4f
4 changed files with 9 additions and 10 deletions

View File

@@ -25,8 +25,7 @@ class ValidStepRule implements WorkflowNodeVisitor {
}
public function initialize(Workflow $workflow): void {
// do not validate for drafts
if ($workflow->getStatus() === Workflow::STATUS_DRAFT) {
if (!$workflow->needsFullValidation()) {
return;
}
@@ -36,8 +35,7 @@ class ValidStepRule implements WorkflowNodeVisitor {
}
public function visitNode(Workflow $workflow, WorkflowNode $node): void {
// do not validate for drafts
if ($workflow->getStatus() === Workflow::STATUS_DRAFT) {
if (!$workflow->needsFullValidation()) {
return;
}
@@ -121,8 +119,7 @@ class ValidStepRule implements WorkflowNodeVisitor {
}
public function complete(Workflow $workflow): void {
// do not validate for drafts
if ($workflow->getStatus() === Workflow::STATUS_DRAFT) {
if (!$workflow->needsFullValidation()) {
return;
}