mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-10 08:44:58 +00:00
Compare commits
4 Commits
v3.12.1
...
fix_filiat
Author | SHA1 | Date | |
---|---|---|---|
34801dcd5f | |||
cc2bee8188 | |||
fb0135a0af | |||
88961e3e7e |
@@ -16,6 +16,7 @@ and this project adheres to
|
||||
* [person-thirdparty]: fix quick-add of names that consist of multiple parts (eg. De Vlieger) within onthefly modal person/thirdparty
|
||||
* [search]: Order of birthdate fields changed in advanced search to avoid confusion.
|
||||
* [workflow]: Constraint added to workflow (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/675)
|
||||
* [filiation]: Allow the deletion of a relationship in filiations (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/608)
|
||||
* [household]: Reposition and cut button for enfant hors menage have been deleted (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/620)
|
||||
|
||||
## Test releases
|
||||
|
@@ -39,6 +39,7 @@ class RelationshipNoDuplicateValidator extends ConstraintValidator
|
||||
|
||||
$fromPerson = $value->getFromPerson();
|
||||
$toPerson = $value->getToPerson();
|
||||
$relationType = $value->getRelation();
|
||||
|
||||
$relationships = $this->relationshipRepository->findBy([
|
||||
'fromPerson' => [$fromPerson, $toPerson],
|
||||
@@ -46,11 +47,11 @@ class RelationshipNoDuplicateValidator extends ConstraintValidator
|
||||
]);
|
||||
|
||||
foreach ($relationships as $r) {
|
||||
if (
|
||||
$r->getFromPerson() === $fromPerson
|
||||
if ($r->getRelation()->getId() !== $relationType->getId()
|
||||
&& ($r->getFromPerson() === $fromPerson
|
||||
|| $r->getFromPerson() === $toPerson
|
||||
|| $r->getToPerson() === $fromPerson
|
||||
|| $r->getToPerson() === $toPerson
|
||||
|| $r->getToPerson() === $toPerson)
|
||||
) {
|
||||
$this->context->buildViolation($constraint->message)
|
||||
->addViolation();
|
||||
|
Reference in New Issue
Block a user