diff --git a/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/EntityToJsonTransformer.php b/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/EntityToJsonTransformer.php index 8f0126049..b51601caf 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/EntityToJsonTransformer.php +++ b/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/EntityToJsonTransformer.php @@ -66,7 +66,7 @@ class EntityToJsonTransformer implements DataTransformerInterface ]); } - private function denormalizeOne(array $item) + private function denormalizeOne(array|string $item) { if (!\array_key_exists('type', $item)) { throw new TransformationFailedException('the key "type" is missing on element'); @@ -76,6 +76,17 @@ class EntityToJsonTransformer implements DataTransformerInterface throw new TransformationFailedException('the key "id" is missing on element'); } + if ('me' === $item) { + // return the denormalized current user + /* return + $this->denormalizer->denormalize( + ['type' => $item['type'], 'id' => $item['id']], + User::class, + 'json', + $context, + );*/ + } + $class = match ($this->type) { 'user' => User::class, 'person' => Person::class, diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ReferrerFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ReferrerFilter.php index 66896f1b8..3573a9363 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ReferrerFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ReferrerFilter.php @@ -68,7 +68,7 @@ class ReferrerFilter implements FilterInterface { $builder ->add('accepted_referrers', PickUserOrMeDynamicType::class, [ - 'multiple' => true, + 'multiple' => false, ]) /* ->add('accepted_referrers', PickUserDynamicType::class, [ 'multiple' => true,