From 9f3893243e2e3b3446da974a0b7f9de05a60e465 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Tue, 8 Oct 2024 16:29:24 +0200 Subject: [PATCH] Adjust gender aggregator --- .../Export/Aggregator/PersonAggregators/GenderAggregator.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/GenderAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/GenderAggregator.php index 95a1f3c5a..033b89a2f 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/GenderAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/GenderAggregator.php @@ -22,7 +22,7 @@ use Symfony\Contracts\Translation\TranslatorInterface; final readonly class GenderAggregator implements AggregatorInterface { - public function __construct(private TranslatorInterface $translator, private TranslatableStringHelperInterface $translatableStringHelper, GenderRepository $repository) {} + public function __construct(private TranslatorInterface $translator, private TranslatableStringHelperInterface $translatableStringHelper, private GenderRepository $repository) {} public function addRole(): ?string { @@ -31,7 +31,8 @@ final readonly class GenderAggregator implements AggregatorInterface public function alterQuery(QueryBuilder $qb, $data) { - $qb->addSelect('person.gender as gender'); + $qb->leftJoin('person.gender', 'g'); + $qb->addSelect('g.id as gender'); $qb->addGroupBy('gender'); }