From: Matthias Schmidt Date: Sat, 22 Oct 2016 07:04:13 +0000 (+0200) Subject: Fix issue with invalid links to moderation queue entry links on first request X-Git-Tag: 3.0.0_Beta_4~37^2~1 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=fa58bdcdb04995efcefe2cb18f835210a107fcdd;p=GitHub%2FWoltLab%2FWCF.git Fix issue with invalid links to moderation queue entry links on first request --- diff --git a/wcfsetup/install/files/lib/form/AbstractModerationForm.class.php b/wcfsetup/install/files/lib/form/AbstractModerationForm.class.php index ed8137e772..a23736ab06 100644 --- a/wcfsetup/install/files/lib/form/AbstractModerationForm.class.php +++ b/wcfsetup/install/files/lib/form/AbstractModerationForm.class.php @@ -7,6 +7,7 @@ use wcf\system\comment\CommentHandler; use wcf\system\event\EventHandler; use wcf\system\exception\IllegalLinkException; use wcf\system\exception\PermissionDeniedException; +use wcf\system\moderation\queue\ModerationQueueManager; use wcf\system\request\LinkHandler; use wcf\system\user\collapsible\content\UserCollapsibleContentHandler; use wcf\system\WCF; @@ -74,6 +75,14 @@ abstract class AbstractModerationForm extends AbstractForm { public function readParameters() { parent::readParameters(); + // if the moderation queue entry has been created after the user visited the + // site the last time, they have not been assigned to the queue entry yet, + // thus `ViewableModerationQueue::getViewableModerationQueue()` will always + // return `null`; `ModerationQueueManager::getOutstandingModerationCount()` + // internally refreshes the user assignments if necessary so that the + // `ViewableModerationQueue::getViewableModerationQueue()` call will be successful + ModerationQueueManager::getInstance()->getOutstandingModerationCount(); + if (isset($_REQUEST['id'])) $this->queueID = intval($_REQUEST['id']); $this->queue = ViewableModerationQueue::getViewableModerationQueue($this->queueID); if ($this->queue === null) {