Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Normal
In XF\Repository\Trophy::updateTrophiesForUser(..) there is a isset to skip already awarded trophies:[code]if (isset($userTrophies[$trophy->trophy_id])){ continue;}[/code]That will return false every time, because the format of the $userTrophies returns an array with key as USER_ID-TROPHY_ID, so to works it should be:[code]if (isset($userTrophies[$user->user_id . '-' . $trophy->trophy_id])){ continue;}[/code](Or directly returns an array with correct key names)
In XF\Repository\Trophy::updateTrophiesForUser(..) there is a isset to skip already awarded trophies:
[code]
if (isset($userTrophies[$trophy->trophy_id]))
{
continue;
}[/code]
That will return false every time, because the format of the $userTrophies returns an array with key as USER_ID-TROPHY_ID, so to works it should be:
if (isset($userTrophies[$user->user_id . '-' . $trophy->trophy_id]))
(Or directly returns an array with correct key names)
We use essential cookies to make this site work, and optional cookies to enhance your experience.
See further information and configure your preferences