DX: Fix aggregator: "group activity by type"

This commit is contained in:
2023-11-20 18:06:55 +01:00
parent c855d0badc
commit b05ed86d1e
2 changed files with 7 additions and 7 deletions

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());
};
}