mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-22 15:43:51 +00:00
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:
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
)
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user