From: Matthias Schmidt Date: Mon, 21 Dec 2020 12:12:35 +0000 (+0100) Subject: Use runtime cache instead of `UserProfile::getUserProfile()` (#3688) X-Git-Tag: 5.4.0_Alpha_1~524 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=3ae645b3c414b19dda7830cc3b6e4a7e35820868;p=GitHub%2FWoltLab%2FWCF.git Use runtime cache instead of `UserProfile::getUserProfile()` (#3688) --- diff --git a/wcfsetup/install/files/lib/form/ModerationReportForm.class.php b/wcfsetup/install/files/lib/form/ModerationReportForm.class.php index b1a10bdeca..2b26f21013 100644 --- a/wcfsetup/install/files/lib/form/ModerationReportForm.class.php +++ b/wcfsetup/install/files/lib/form/ModerationReportForm.class.php @@ -2,6 +2,7 @@ namespace wcf\form; use wcf\data\user\User; use wcf\data\user\UserProfile; +use wcf\system\cache\runtime\UserProfileRuntimeCache; use wcf\system\exception\IllegalLinkException; use wcf\system\moderation\queue\report\IModerationQueueReportHandler; use wcf\system\moderation\queue\ModerationQueueManager; @@ -35,8 +36,11 @@ class ModerationReportForm extends AbstractModerationForm { public function assignVariables() { parent::assignVariables(); - $reportUser = UserProfile::getUserProfile($this->queue->userID); - if ($reportUser === null) $reportUser = new UserProfile(new User(null, [])); + $reportUser = UserProfileRuntimeCache::getInstance()->getObject($this->queue->userID); + if ($reportUser === null) { + $reportUser = new UserProfile(new User(null, [])); + } + WCF::getTPL()->assign([ 'reportedContent' => ModerationQueueReportManager::getInstance()->getReportedContent($this->queue), 'queueManager' => ModerationQueueReportManager::getInstance(),