From 2883e085edad1be325e31106eb44f61022e3d588 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Mon, 20 Nov 2023 18:07:06 +0100 Subject: [PATCH] DX: Fix aggregator: "group activity by reason" --- .changes/unreleased/Fixed-20231120-174952.yaml | 5 +++++ .../PersonAggregators/ActivityReasonAggregator.php | 6 ------ 2 files changed, 5 insertions(+), 6 deletions(-) create mode 100644 .changes/unreleased/Fixed-20231120-174952.yaml diff --git a/.changes/unreleased/Fixed-20231120-174952.yaml b/.changes/unreleased/Fixed-20231120-174952.yaml new file mode 100644 index 000000000..a10817f0f --- /dev/null +++ b/.changes/unreleased/Fixed-20231120-174952.yaml @@ -0,0 +1,5 @@ +kind: Fixed +body: 'Export: fix loading of "group activity by reasons"' +time: 2023-11-20T17:49:52.416508936+01:00 +custom: + Issue: "190" diff --git a/src/Bundle/ChillActivityBundle/Export/Aggregator/PersonAggregators/ActivityReasonAggregator.php b/src/Bundle/ChillActivityBundle/Export/Aggregator/PersonAggregators/ActivityReasonAggregator.php index 4b1f4894e..f0364bf8e 100644 --- a/src/Bundle/ChillActivityBundle/Export/Aggregator/PersonAggregators/ActivityReasonAggregator.php +++ b/src/Bundle/ChillActivityBundle/Export/Aggregator/PersonAggregators/ActivityReasonAggregator.php @@ -99,12 +99,6 @@ class ActivityReasonAggregator implements AggregatorInterface, ExportElementVali public function getLabels($key, array $values, $data) { - match ($data['level']) { - 'reasons' => $this->activityReasonRepository->findBy(['id' => $values]), - 'categories' => $this->activityReasonCategoryRepository->findBy(['id' => $values]), - default => throw new \RuntimeException(sprintf("The level data '%s' is invalid.", $data['level'])), - }; - return function ($value) use ($data) { if ('_header' === $value) { return 'reasons' === $data['level'] ? 'Group by reasons' : 'Group by categories of reason';