From 21b605c87fc7b1f0a493396d9765ef790d89cc5e Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Wed, 31 Jul 2013 19:40:18 +0200 Subject: [PATCH] Fixed moderation queues not reappearing if content is moderated again --- .../AbstractModerationQueueManager.class.php | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/wcfsetup/install/files/lib/system/moderation/queue/AbstractModerationQueueManager.class.php b/wcfsetup/install/files/lib/system/moderation/queue/AbstractModerationQueueManager.class.php index 080998e33a..69b9260cb5 100644 --- a/wcfsetup/install/files/lib/system/moderation/queue/AbstractModerationQueueManager.class.php +++ b/wcfsetup/install/files/lib/system/moderation/queue/AbstractModerationQueueManager.class.php @@ -74,7 +74,7 @@ abstract class AbstractModerationQueueManager extends SingletonFactory implement * @param array $additionalData */ protected function addEntry($objectTypeID, $objectID, $containerID = 0, array $additionalData = array()) { - $sql = "SELECT COUNT(*) AS count + $sql = "SELECT queueID FROM wcf".WCF_N."_moderation_queue WHERE objectTypeID = ? AND objectID = ?"; @@ -85,7 +85,7 @@ abstract class AbstractModerationQueueManager extends SingletonFactory implement )); $row = $statement->fetchArray(); - if ($row['count'] == 0) { + if ($row === false) { $objectAction = new ModerationQueueAction(array(), 'create', array( 'data' => array( 'objectTypeID' => $objectTypeID, @@ -97,9 +97,21 @@ abstract class AbstractModerationQueueManager extends SingletonFactory implement ) )); $objectAction->executeAction(); - - ModerationQueueManager::getInstance()->resetModerationCount(); } + else { + $objectAction = new ModerationQueueAction(array($row['queueID']), 'update', array( + 'data' => array( + 'status' => ModerationQueue::STATUS_OUTSTANDING, + 'containerID' => $containerID, + 'userID' => (WCF::getUser()->userID ?: null), + 'time' => TIME_NOW, + 'additionalData' => serialize($additionalData) + ) + )); + $objectAction->executeAction(); + } + + ModerationQueueManager::getInstance()->resetModerationCount(); } /** -- 2.20.1