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';