From a7240e8cc6fa7a7699cfeef2a02188ce55fa76f7 Mon Sep 17 00:00:00 2001 From: nobohan Date: Tue, 1 Mar 2022 14:15:39 +0100 Subject: [PATCH] PersonJsonNormalizer: fix circular reference with residential address --- .../Serializer/Normalizer/PersonJsonNormalizer.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/PersonJsonNormalizer.php b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/PersonJsonNormalizer.php index a79a2f6cd..f13a6d40d 100644 --- a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/PersonJsonNormalizer.php +++ b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/PersonJsonNormalizer.php @@ -197,7 +197,7 @@ class PersonJsonNormalizer implements DenormalizerAwareInterface, NormalizerAwar 'age' => $this->normalizer->normalize($person->getAge(), $format, $context), ]; - if (in_array("minimal", $groups) && 1 === count($context)) { + if (in_array("minimal", $groups) && 1 === count($groups)) { return $data; } @@ -209,7 +209,9 @@ class PersonJsonNormalizer implements DenormalizerAwareInterface, NormalizerAwar 'altNames' => $this->normalizeAltNames($person->getAltNames()), 'gender' => $person->getGender(), 'current_household_id' => $household ? $this->normalizer->normalize($household->getId(), $format, $context) : null, - 'current_residential_addresses' => $currentResidentialAddresses ? $this->normalizer->normalize($currentResidentialAddresses, $format, $context) : null, + 'current_residential_addresses' => $currentResidentialAddresses ? + $this->normalizer->normalize($currentResidentialAddresses, $format, $context) : + null, ]); }