From dca17c409b5fd112f1ebe0abc97fb0917db383b5 Mon Sep 17 00:00:00 2001 From: nobohan Date: Thu, 3 Mar 2022 12:03:22 +0100 Subject: [PATCH 1/3] activity: do not override location if already exist (when validating new activity) --- .../Resources/public/vuejs/Activity/store.locations.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/store.locations.js b/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/store.locations.js index 311bdc219..6125140a5 100644 --- a/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/store.locations.js +++ b/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/store.locations.js @@ -110,10 +110,8 @@ export default function prepareLocations(store) { console.log('default loation id', window.default_location_id); if (window.default_location_id) { for (let group of store.state.availableLocations) { - console.log(group); let location = group.locations.find((l) => l.id === window.default_location_id); - console.log(location); - if (location !== undefined) { + if (location !== undefined & store.state.activity.location === null) { store.dispatch('updateLocation', location); break; } From 1b66941746a3bdbc51daabe9458f07800858a863 Mon Sep 17 00:00:00 2001 From: nobohan Date: Thu, 3 Mar 2022 12:05:55 +0100 Subject: [PATCH 2/3] upd CHANGELOG --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3bd743078..daf880138 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,8 @@ and this project adheres to ## Unreleased +* [activity] do not override location if already exist (when validating new activity) (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/470) + * [parcours] Toggle emergency/intensity only by referrer (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/442) * [docstore] Add an API entrypoint for StoredObject (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/466) * [person] Add the possibility of uploading existing documents to AccPeriodWorkEvaluationDocument (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/466) From f0e41f839fdcfc44d4660628565c7289ec18c27f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Thu, 3 Mar 2022 14:39:20 +0100 Subject: [PATCH 3/3] fix error when context is a string in personJsonNormalizer --- .../Serializer/Normalizer/PersonJsonNormalizer.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/PersonJsonNormalizer.php b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/PersonJsonNormalizer.php index 1901fd50c..1969fffa7 100644 --- a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/PersonJsonNormalizer.php +++ b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/PersonJsonNormalizer.php @@ -189,6 +189,9 @@ class PersonJsonNormalizer implements DenormalizerAwareInterface, NormalizerAwar public function normalize($person, $format = null, array $context = []) { $groups = $context[AbstractNormalizer::GROUPS] ?? []; + if (is_string($groups)) { + $groups = [$groups]; + } $household = $person->getCurrentHousehold(); $currentResidentialAddresses = $this->residentialAddressRepository->findCurrentResidentialAddressByPerson($person);