From 6bf8789f8539bc0fe6d64c5321c5107a1556cd9c Mon Sep 17 00:00:00 2001 From: nobohan Date: Wed, 29 Mar 2023 21:07:25 +0200 Subject: [PATCH] Feature: add cc users in workflow: correct constraint validation --- .../Validator/Constraints/Entity/WorkflowStepUsersValidator.php | 2 +- src/Bundle/ChillMainBundle/translations/validators.fr.yml | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Bundle/ChillMainBundle/Validator/Constraints/Entity/WorkflowStepUsersValidator.php b/src/Bundle/ChillMainBundle/Validator/Constraints/Entity/WorkflowStepUsersValidator.php index 9f3684575..7a45543f8 100644 --- a/src/Bundle/ChillMainBundle/Validator/Constraints/Entity/WorkflowStepUsersValidator.php +++ b/src/Bundle/ChillMainBundle/Validator/Constraints/Entity/WorkflowStepUsersValidator.php @@ -31,7 +31,7 @@ class WorkflowStepUsersValidator extends ConstraintValidator throw new UnexpectedTypeException($constraint, WorkflowStepUsers::class); } - foreach($value->getCcUser() as $u) { + foreach($value->getDestUser() as $u) { if ($value->getCcUser()->contains($u)) { $this->context ->buildViolation($constraint->message) diff --git a/src/Bundle/ChillMainBundle/translations/validators.fr.yml b/src/Bundle/ChillMainBundle/translations/validators.fr.yml index 690629e44..31d3bdc73 100644 --- a/src/Bundle/ChillMainBundle/translations/validators.fr.yml +++ b/src/Bundle/ChillMainBundle/translations/validators.fr.yml @@ -11,6 +11,8 @@ A permission is already present for the same role and scope: Une permission est #UserCircleConsistency "{{ username }} is not allowed to see entities published in this circle": "{{ username }} n'est pas autorisé à voir l'élément publié dans ce cercle." +The user in cc cannot be a dest user in the same workflow step: Un utilisateur en Cc ne peut pas être un utilisateur qui valide. + #password request This username or email does not exists: Cet utilisateur ou email n'est pas présent dans la base de donnée