exports: fix activitytype filter/aggregator appliedTo activity_person and too activity_acl

This commit is contained in:
2022-08-17 15:27:37 +02:00
parent c09c7a9615
commit c17036fcda
6 changed files with 45 additions and 45 deletions

View File

@@ -45,16 +45,24 @@ class ActivityTypeAggregator implements AggregatorInterface
public function alterQuery(QueryBuilder $qb, $data)
{
// add select element
$qb->addSelect(sprintf('IDENTITY(activity.type) AS %s', self::KEY));
if (!in_array('type', $qb->getAllAliases())) {
$qb->join('activity.activityType', 'type');
}
// add the "group by" part
$qb->addGroupBy(self::KEY);
$qb->addSelect(sprintf('IDENTITY(activity.activityType) AS %s', self::KEY));
$groupby = $qb->getDQLPart('groupBy');
if (!empty($groupBy)) {
$qb->addGroupBy(self::KEY);
} else {
$qb->groupBy(self::KEY);
}
}
public function applyOn(): string
{
return Declarations::ACTIVITY_PERSON;
return Declarations::ACTIVITY;
}
public function buildForm(FormBuilderInterface $builder)