From 3ae645b3c414b19dda7830cc3b6e4a7e35820868 Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Mon, 21 Dec 2020 13:12:35 +0100 Subject: [PATCH] Use runtime cache instead of `UserProfile::getUserProfile()` (#3688) --- .../install/files/lib/form/ModerationReportForm.class.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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(), -- 2.20.1