Merge branch '82_bundles_filiation_delete_fix' into 'master'

#82 filiation delete/patch fix

See merge request Chill-Projet/chill-bundles!548
This commit is contained in:
Julien Fastré 2023-06-21 12:17:34 +00:00
commit 45724100d4

View File

@ -46,11 +46,13 @@ class RelationshipNoDuplicateValidator extends ConstraintValidator
]);
foreach ($relationships as $r) {
if (
$r->getFromPerson() === $fromPerson
|| $r->getFromPerson() === $toPerson
|| $r->getToPerson() === $fromPerson
|| $r->getToPerson() === $toPerson
if (spl_object_hash($r) !== spl_object_hash($value)
and
(
($r->getFromPerson() === $fromPerson and $r->getToPerson() === $toPerson)
||
($r->getFromPerson() === $toPerson and $r->getToPerson() === $fromPerson)
)
) {
$this->context->buildViolation($constraint->message)
->addViolation();