diff --git a/src/Bundle/ChillPersonBundle/Repository/Household/HouseholdACLAwareRepository.php b/src/Bundle/ChillPersonBundle/Repository/Household/HouseholdACLAwareRepository.php index 7cc9e7dbe..c0034eea0 100644 --- a/src/Bundle/ChillPersonBundle/Repository/Household/HouseholdACLAwareRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/Household/HouseholdACLAwareRepository.php @@ -41,8 +41,9 @@ final readonly class HouseholdACLAwareRepository implements HouseholdACLAwareRep $qb ->join($alias . '.members', 'members') ->join('members.person', 'person') + ->join('person.centerCurrent', 'person_center_current') ->andWhere( - $qb->expr()->in('person.center', ':centers') + $qb->expr()->in('person_center_current.center', ':centers') ) ->setParameter('centers', $centers); diff --git a/src/Bundle/ChillPersonBundle/Tests/Controller/HouseholdApiControllerTest.php b/src/Bundle/ChillPersonBundle/Tests/Controller/HouseholdApiControllerTest.php index 10a571728..365904f0d 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Controller/HouseholdApiControllerTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Controller/HouseholdApiControllerTest.php @@ -76,7 +76,8 @@ final class HouseholdApiControllerTest extends WebTestCase $em->persist($p); $h = new Household(); $h->addMember($m = (new HouseholdMember())->setPerson($p)); - $h->addAddress(Address::createFromAddressReference($reference)->setValidFrom(new DateTime('today'))); + $h->addAddress($a = Address::createFromAddressReference($reference)->setValidFrom(new DateTime('today'))); + $em->persist($a); $em->persist($m); $em->persist($h);