Fix marking special trophies as special, if the user which awards the trophy has...
authorjoshuaruesweg <ruesweg@woltlab.com>
Sun, 31 May 2020 18:09:28 +0000 (20:09 +0200)
committerjoshuaruesweg <ruesweg@woltlab.com>
Sun, 31 May 2020 18:10:38 +0000 (20:10 +0200)
wcfsetup/install/files/lib/data/user/trophy/UserTrophyAction.class.php

index dea4a5502b6aaf6de859236378c0235c6f125dbb..d3adf4cb771949b253fa4c5589884448c9281d81 100644 (file)
@@ -60,7 +60,7 @@ class UserTrophyAction extends AbstractDatabaseObjectAction {
                        // checks if the user still has space to add special trophies
                        if (count($userTrophy->getUserProfile()->getSpecialTrophies()) < $userTrophy->getUserProfile()->getPermission('user.profile.trophy.maxUserSpecialTrophies')) {
                                $hasTrophy = false;
-                               foreach (UserTrophyList::getUserTrophies([WCF::getUser()->userID])[WCF::getUser()->userID] as $trophy) {
+                               foreach (UserTrophyList::getUserTrophies([$userTrophy->getUserProfile()->userID])[$userTrophy->getUserProfile()->userID] as $trophy) {
                                        if ($trophy->trophyID == $userTrophy->trophyID && $trophy->userTrophyID !== $userTrophy->userTrophyID) {
                                                $hasTrophy = true; 
                                                break;