It's no longer necessary to joins the user_rank table.
$this->readObjects();
}
- $resetUserIDs = $userToRank = [];
+ $userToRank = [];
foreach ($this->getObjects() as $user) {
$conditionBuilder = new PreparedStatementConditionBuilder();
$conditionBuilder->add('user_rank.groupID IN (?)', [$user->getGroupIDs()]);
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;
}
}
}
}
WCF::getDB()->commitTransaction();
}
-
- if (!empty($resetUserIDs)) {
- UserStorageHandler::getInstance()->reset($resetUserIDs, 'userRank');
- }
}
/**
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 .= "
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.*";
}
}
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.*";
}
}