Fixed: [workflow] validation of users in cc and dest

The validation is processed at the form step, so before the transition is processed
This commit is contained in:
2023-04-13 12:24:44 +02:00
parent 63759a940f
commit a21637331f
7 changed files with 24 additions and 75 deletions

View File

@@ -243,6 +243,20 @@ class WorkflowStepType extends AbstractType
}
}
),
new Callback(
function ($step, ExecutionContextInterface $context, $payload) {
$form = $context->getObject();
foreach($form->get('future_dest_users')->getData() as $u) {
if (in_array($u, $form->get('future_cc_users')->getData(), true)) {
$context
->buildViolation('workflow.The user in cc cannot be a dest user in the same workflow step')
->atPath('ccUsers')
->addViolation();
}
}
}
)
]);
}
}