DX: Fix aggregator: "group activity by type"

This commit is contained in:
Julien Fastré 2023-11-20 18:06:55 +01:00
parent c855d0badc
commit b05ed86d1e
Signed by: julienfastre
GPG Key ID: BDE2190974723FCB
2 changed files with 7 additions and 7 deletions

View File

@ -0,0 +1,5 @@
kind: Fixed
body: 'Export: fix loading of "Group activity by type"'
time: 2023-11-20T17:46:03.999758401+01:00
custom:
Issue: "211"

View File

@ -56,20 +56,15 @@ class ActivityTypeAggregator implements AggregatorInterface
public function getLabels($key, array $values, $data): \Closure
{
// for performance reason, we load data from db only once
$this->activityTypeRepository->findBy(['id' => $values]);
return function ($value): string {
return function (null|int|string $value): string {
if ('_header' === $value) {
return 'Activity type';
}
if (null === $value || '' === $value) {
if (null === $value || '' === $value || null === $t = $this->activityTypeRepository->find($value)) {
return '';
}
$t = $this->activityTypeRepository->find($value);
return $this->translatableStringHelper->localize($t->getName());
};
}