diff --git a/.changes/unreleased/Fixed-20241211-151057.yaml b/.changes/unreleased/Fixed-20241211-151057.yaml new file mode 100644 index 000000000..8b341137c --- /dev/null +++ b/.changes/unreleased/Fixed-20241211-151057.yaml @@ -0,0 +1,5 @@ +kind: Fixed +body: 'Export: activity filtering of users that were associated to an activity between certain dates. Results contained activities that were not within the specified date range"' +time: 2024-12-11T15:10:57.973144789+01:00 +custom: + Issue: "345" diff --git a/src/Bundle/ChillActivityBundle/Export/Filter/PersonFilters/PersonHavingActivityBetweenDateFilter.php b/src/Bundle/ChillActivityBundle/Export/Filter/PersonFilters/PersonHavingActivityBetweenDateFilter.php index 2f734d237..6362b8295 100644 --- a/src/Bundle/ChillActivityBundle/Export/Filter/PersonFilters/PersonHavingActivityBetweenDateFilter.php +++ b/src/Bundle/ChillActivityBundle/Export/Filter/PersonFilters/PersonHavingActivityBetweenDateFilter.php @@ -55,6 +55,8 @@ final readonly class PersonHavingActivityBetweenDateFilter implements ExportElem .' AND ' .'(person_person_having_activity.id = person.id OR person MEMBER OF activity_person_having_activity.persons)'); + $sqb->andWhere('activity_person_having_activity.id = activity.id'); + if (isset($data['reasons']) && [] !== $data['reasons']) { // add clause activity reason $sqb->join('activity_person_having_activity.reasons', 'reasons_person_having_activity');