This commit is contained in:
Julien Fastré 2022-04-14 00:11:15 +02:00
parent 31731c6f44
commit e6d59bc837
2 changed files with 11 additions and 4 deletions

View File

@ -1,5 +1,14 @@
<?php
/**
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\MainBundle\Form\Type;
use Chill\MainBundle\Entity\Address;
@ -25,5 +34,4 @@ class AddressDateType extends AbstractType
{
$resolver->setDefault('data_class', Address::class);
}
}

View File

@ -13,7 +13,6 @@ namespace Chill\PersonBundle\Controller;
use Chill\MainBundle\Entity\Address;
use Chill\MainBundle\Form\Type\AddressDateType;
use Chill\MainBundle\Form\Type\AddressType;
use Chill\PersonBundle\Entity\Household\Household;
use Chill\PersonBundle\Form\HouseholdType;
use Chill\PersonBundle\Repository\Household\PositionRepository;
@ -208,12 +207,12 @@ class HouseholdController extends AbstractController
$address_id = $request->query->getInt('address_id');
// loop over adresses of the household, to be sure that the household is associated
// to the edited address
$address = null;
foreach ($household->getAddresses() as $householdAddress) {
if ($address_id === $householdAddress->getId()) {
if ($householdAddress->getId() === $address_id) {
$address = $householdAddress;
}
}