From d24ec35e7031144307923875fa6fdfeda50abce4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Joshua=20R=C3=BCsweg?= Date: Mon, 20 Jan 2020 17:37:41 +0100 Subject: [PATCH] Fix revoking of user trophies --- .../system/trophy/condition/TrophyConditionHandler.class.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/wcfsetup/install/files/lib/system/trophy/condition/TrophyConditionHandler.class.php b/wcfsetup/install/files/lib/system/trophy/condition/TrophyConditionHandler.class.php index 09bc0c88c1..c7da8e79cf 100644 --- a/wcfsetup/install/files/lib/system/trophy/condition/TrophyConditionHandler.class.php +++ b/wcfsetup/install/files/lib/system/trophy/condition/TrophyConditionHandler.class.php @@ -182,6 +182,9 @@ class TrophyConditionHandler extends SingletonFactory { // In order not to get all users who do not fulfill the conditions (in case of // doubt there can be many), we filter for users who have received the trophy. $userList->getConditionBuilder()->add('user_table.userID IN (SELECT userID FROM wcf'.WCF_N.'_user_trophy WHERE trophyID IN (?))', [$trophy->trophyID]); + + // Prevents us from getting faulty UserTrophyIDs. + $userList->getConditionBuilder()->add('user_trophy.trophyID = ?', [$trophy->trophyID]); $userList->readObjects(); // We now return an array of userTrophyIDs instead of user objects to remove them directly via DBOAction. -- 2.20.1