diff --git a/.changes/unreleased/Fixed-20250214-121010.yaml b/.changes/unreleased/Fixed-20250214-121010.yaml new file mode 100644 index 000000000..d7000c11c --- /dev/null +++ b/.changes/unreleased/Fixed-20250214-121010.yaml @@ -0,0 +1,6 @@ +kind: Fixed +body: fix generation of document with accompanying period context, and list of activities and works +time: 2025-02-14T12:10:10.920355454+01:00 +custom: + Issue: "" + SchemaChange: No schema change diff --git a/src/Bundle/ChillActivityBundle/Service/DocGenerator/ListActivitiesByAccompanyingPeriodContext.php b/src/Bundle/ChillActivityBundle/Service/DocGenerator/ListActivitiesByAccompanyingPeriodContext.php index 56b9de408..9b473309e 100644 --- a/src/Bundle/ChillActivityBundle/Service/DocGenerator/ListActivitiesByAccompanyingPeriodContext.php +++ b/src/Bundle/ChillActivityBundle/Service/DocGenerator/ListActivitiesByAccompanyingPeriodContext.php @@ -143,7 +143,10 @@ class ListActivitiesByAccompanyingPeriodContext implements array_filter( $works, function ($work) use ($user) { - $workUsernames = array_map(static fn (User $user) => $user['username'], $work['referrers'] ?? []); + $workUsernames = []; + foreach ($work['referrers'] as $referrer) { + $workUsernames[] = $referrer['username']; + } return \in_array($user->getUserIdentifier(), $workUsernames, true); }