From 19e51cc74c891fb085adf15787d8f15b24b5370f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Fri, 14 Apr 2023 12:11:04 +0200 Subject: [PATCH 1/2] Fix: new column name in hexasmal data for geographical coordinates --- .../Service/Import/PostalCodeFRFromOpenData.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Service/Import/PostalCodeFRFromOpenData.php b/src/Bundle/ChillMainBundle/Service/Import/PostalCodeFRFromOpenData.php index f6cc2bd99..e2d25350d 100644 --- a/src/Bundle/ChillMainBundle/Service/Import/PostalCodeFRFromOpenData.php +++ b/src/Bundle/ChillMainBundle/Service/Import/PostalCodeFRFromOpenData.php @@ -78,8 +78,8 @@ class PostalCodeFRFromOpenData private function handleRecord(array $record): void { - if ('' !== trim($record['coordonnees_gps'])) { - [$lat, $lon] = array_map(static fn ($el) => (float) trim($el), explode(',', $record['coordonnees_gps'])); + if ('' !== trim($record['coordonnees_geographiques'] ?? $record['coordonnees_gps'])) { + [$lat, $lon] = array_map(static fn ($el) => (float) trim($el), explode(',', $record['coordonnees_geographiques'] ?? $record['coordonnees_gps'])); } else { $lat = $lon = 0.0; } From d759b9c727cbda1e7cb39df6a2474d2596aba6cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Fri, 14 Apr 2023 13:11:29 +0200 Subject: [PATCH 2/2] Fixed: [import social work metadata] make association from parent/child SocialIssue and SocialAction on the owning side --- .../ChillPersonBundle/Service/Import/SocialWorkMetadata.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Service/Import/SocialWorkMetadata.php b/src/Bundle/ChillPersonBundle/Service/Import/SocialWorkMetadata.php index f1050b134..3d7b60254 100644 --- a/src/Bundle/ChillPersonBundle/Service/Import/SocialWorkMetadata.php +++ b/src/Bundle/ChillPersonBundle/Service/Import/SocialWorkMetadata.php @@ -287,7 +287,7 @@ final class SocialWorkMetadata implements SocialWorkMetadataInterface $return['socialActionChild'] = $previousSocialActionChild; } else { $return['socialActionChild'] = $child = (new SocialAction())->setTitle(['fr' => $socialActionChildTitle]); - $parent->addChild($child); + $child->setParent($parent); $child->setIssue($socialIssue)->setOrdering($orderingChild); $this->entityManager->persist($child); } @@ -332,7 +332,7 @@ final class SocialWorkMetadata implements SocialWorkMetadataInterface } elseif (null !== $socialIssueChildTitle) { $return['socialIssueChild'] = $child = (new SocialIssue())->setTitle(['fr' => $socialIssueChildTitle]) ->setOrdering($orderingChild); - $parent->addChild($child); + $child->setParent($parent); $this->entityManager->persist($child); } else { $return['socialIssueChild'] = null;