Remove obsolete code
authorMarcel Werk <burntime@woltlab.com>
Sun, 4 Feb 2024 16:31:16 +0000 (17:31 +0100)
committerMarcel Werk <burntime@woltlab.com>
Sun, 4 Feb 2024 16:31:16 +0000 (17:31 +0100)
It's no longer necessary to joins the user_rank table.

wcfsetup/install/files/lib/data/user/UserProfileAction.class.php
wcfsetup/install/files/lib/data/user/UserProfileList.class.php
wcfsetup/install/files/lib/data/user/follow/UserFollowingList.class.php
wcfsetup/install/files/lib/data/user/ignore/ViewableUserIgnoreList.class.php

index b21764e628a692932f1c38fc78eab41bb9578270..cf700a79d6db16385380cda82fc6a65c20ba23cb 100644 (file)
@@ -338,7 +338,7 @@ class UserProfileAction extends UserAction
             $this->readObjects();
         }
 
-        $resetUserIDs = $userToRank = [];
+        $userToRank = [];
         foreach ($this->getObjects() as $user) {
             $conditionBuilder = new PreparedStatementConditionBuilder();
             $conditionBuilder->add('user_rank.groupID IN (?)', [$user->getGroupIDs()]);
@@ -361,12 +361,10 @@ class UserProfileAction extends UserAction
             if ($row === false) {
                 if ($user->rankID) {
                     $userToRank[$user->userID] = null;
-                    $resetUserIDs[] = $user->userID;
                 }
             } else {
                 if ($row['rankID'] != $user->rankID) {
                     $userToRank[$user->userID] = $row['rankID'];
-                    $resetUserIDs[] = $user->userID;
                 }
             }
         }
@@ -386,10 +384,6 @@ class UserProfileAction extends UserAction
             }
             WCF::getDB()->commitTransaction();
         }
-
-        if (!empty($resetUserIDs)) {
-            UserStorageHandler::getInstance()->reset($resetUserIDs, 'userRank');
-        }
     }
 
     /**
index 5abf37a16e4e62de6cef8c44c68c93f943fbcf49..dcbf27e1a576d96e6b9160fb713f6492ec8939a9 100644 (file)
@@ -42,13 +42,6 @@ class UserProfileList extends UserList
             LEFT JOIN   wcf" . WCF_N . "_user_avatar user_avatar
             ON          user_avatar.avatarID = user_table.avatarID";
 
-        if (MODULE_USER_RANK) {
-            $this->sqlSelects .= ",user_rank.*";
-            $this->sqlJoins .= "
-                LEFT JOIN   wcf" . WCF_N . "_user_rank user_rank
-                ON          user_rank.rankID = user_table.rankID";
-        }
-
         // get current location
         $this->sqlSelects .= ", session.pageID, session.pageObjectID, session.lastActivityTime AS sessionLastActivityTime";
         $this->sqlJoins .= "
index 6e69be45c30f330d5d4b15f2fcc448a9d8bd38cb..52abde2adcdb5ecb95ad977912325cb6c5537524 100644 (file)
@@ -35,13 +35,6 @@ class UserFollowingList extends UserFollowerList
             LEFT JOIN   wcf" . WCF_N . "_user_avatar user_avatar
             ON          user_avatar.avatarID = user_table.avatarID";
 
-        if (MODULE_USER_RANK) {
-            $this->sqlSelects .= ",user_rank.*";
-            $this->sqlJoins .= "
-                LEFT JOIN   wcf" . WCF_N . "_user_rank user_rank
-                ON          user_rank.rankID = user_table.rankID";
-        }
-
         $this->sqlSelects .= ", user_table.*";
     }
 }
index 641ee47ae9bf78d90cfe8065cef3ede55636f492..b1b3d6940f83b639d70388e91ff853f651d447fa 100644 (file)
@@ -56,13 +56,6 @@ class ViewableUserIgnoreList extends UserIgnoreList
             LEFT JOIN   wcf" . WCF_N . "_user_avatar user_avatar
             ON          user_avatar.avatarID = user_table.avatarID";
 
-        if (MODULE_USER_RANK) {
-            $this->sqlSelects .= ",user_rank.*";
-            $this->sqlJoins .= "
-                LEFT JOIN   wcf" . WCF_N . "_user_rank user_rank
-                ON          user_rank.rankID = user_table.rankID";
-        }
-
         $this->sqlSelects .= ", user_table.*";
     }
 }