mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
DX: Fix aggregator: "group activity by type"
This commit is contained in:
parent
c855d0badc
commit
b05ed86d1e
5
.changes/unreleased/Fixed-20231120-174603.yaml
Normal file
5
.changes/unreleased/Fixed-20231120-174603.yaml
Normal 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"
|
@ -56,20 +56,15 @@ class ActivityTypeAggregator implements AggregatorInterface
|
|||||||
|
|
||||||
public function getLabels($key, array $values, $data): \Closure
|
public function getLabels($key, array $values, $data): \Closure
|
||||||
{
|
{
|
||||||
// for performance reason, we load data from db only once
|
return function (null|int|string $value): string {
|
||||||
$this->activityTypeRepository->findBy(['id' => $values]);
|
|
||||||
|
|
||||||
return function ($value): string {
|
|
||||||
if ('_header' === $value) {
|
if ('_header' === $value) {
|
||||||
return 'Activity type';
|
return 'Activity type';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (null === $value || '' === $value) {
|
if (null === $value || '' === $value || null === $t = $this->activityTypeRepository->find($value)) {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
$t = $this->activityTypeRepository->find($value);
|
|
||||||
|
|
||||||
return $this->translatableStringHelper->localize($t->getName());
|
return $this->translatableStringHelper->localize($t->getName());
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user