mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
Replace getUsername with getUserIdentifier in activity checks
Updated activity checks in ListActivitiesByAccompanyingPeriodContext to use getUserIdentifier method instead of getUsername. This change corresponds to check for both activity users and work referrers. The getUserIdentifier method grants a more reliable way to identify users.
This commit is contained in:
parent
931c69eee4
commit
828304d983
@ -122,13 +122,13 @@ class ListActivitiesByAccompanyingPeriodContext implements
|
|||||||
function ($activity) use ($user) {
|
function ($activity) use ($user) {
|
||||||
$u = $activity['user'];
|
$u = $activity['user'];
|
||||||
|
|
||||||
if (null !== $u && $u['username'] === $user->getUsername()) {
|
if (null !== $u && $u['username'] === $user->getUserIdentifier()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
$activityUsernames = array_map(static fn ($user) => $user['username'], $activity['users'] ?? []);
|
$activityUsernames = array_map(static fn ($user) => $user['username'], $activity['users'] ?? []);
|
||||||
|
|
||||||
return \in_array($user->getUsername(), $activityUsernames, true);
|
return \in_array($user->getUserIdentifier(), $activityUsernames, true);
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
@ -143,9 +143,9 @@ class ListActivitiesByAccompanyingPeriodContext implements
|
|||||||
array_filter(
|
array_filter(
|
||||||
$works,
|
$works,
|
||||||
function ($work) use ($user) {
|
function ($work) use ($user) {
|
||||||
$workUsernames = array_map(static fn ($user) => $user['username'], $work['referrers'] ?? []);
|
$workUsernames = array_map(static fn (User $user) => $user['username'], $work['referrers'] ?? []);
|
||||||
|
|
||||||
return \in_array($user->getUsername(), $workUsernames, true);
|
return \in_array($user->getUserIdentifier(), $workUsernames, true);
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user