From: Alexander Ebert Date: Sun, 2 Nov 2014 14:38:41 +0000 (+0100) Subject: Fixed moderation queue not properly handling new states X-Git-Tag: 2.1.0_Alpha_1~95 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=e04ca5856ce6e7eaf840f03020cf25945490517a;p=GitHub%2FWoltLab%2FWCF.git Fixed moderation queue not properly handling new states Fixes #1836 --- diff --git a/wcfsetup/install/files/lib/data/moderation/queue/ModerationQueueAction.class.php b/wcfsetup/install/files/lib/data/moderation/queue/ModerationQueueAction.class.php index 8345d1dba3..ab8ef634fe 100644 --- a/wcfsetup/install/files/lib/data/moderation/queue/ModerationQueueAction.class.php +++ b/wcfsetup/install/files/lib/data/moderation/queue/ModerationQueueAction.class.php @@ -104,7 +104,7 @@ class ModerationQueueAction extends AbstractDatabaseObjectAction { $queueList = new ViewableModerationQueueList(); $queueList->getConditionBuilder()->add("moderation_queue.objectTypeID IN (?)", array($objectTypeIDs)); - $queueList->getConditionBuilder()->add("moderation_queue.status <> ?", array(ModerationQueue::STATUS_DONE)); + $queueList->getConditionBuilder()->add("moderation_queue.status IN (?)", array(array(ModerationQueue::STATUS_OUTSTANDING, ModerationQueue::STATUS_PROCESSING))); $queueList->sqlOrderBy = 'moderation_queue.lastChangeTime DESC'; $queueList->sqlLimit = 5; $queueList->loadUserProfiles = true; diff --git a/wcfsetup/install/files/lib/system/moderation/queue/ModerationQueueManager.class.php b/wcfsetup/install/files/lib/system/moderation/queue/ModerationQueueManager.class.php index 27a209096f..4ec7d9dd22 100644 --- a/wcfsetup/install/files/lib/system/moderation/queue/ModerationQueueManager.class.php +++ b/wcfsetup/install/files/lib/system/moderation/queue/ModerationQueueManager.class.php @@ -243,19 +243,18 @@ class ModerationQueueManager extends SingletonFactory { } // count outstanding and assigned queues + $conditions = new PreparedStatementConditionBuilder(); + $conditions->add("moderation_queue_to_user.userID = ?", array(WCF::getUser()->userID)); + $conditions->add("moderation_queue_to_user.isAffected = ?", array(1)); + $conditions->add("moderation_queue.status IN (?)", array(array(ModerationQueue::STATUS_OUTSTANDING, ModerationQueue::STATUS_PROCESSING))); + $sql = "SELECT COUNT(*) AS count FROM wcf".WCF_N."_moderation_queue_to_user moderation_queue_to_user LEFT JOIN wcf".WCF_N."_moderation_queue moderation_queue ON (moderation_queue.queueID = moderation_queue_to_user.queueID) - WHERE moderation_queue_to_user.userID = ? - AND moderation_queue_to_user.isAffected = ? - AND moderation_queue.status <> ?"; + ".$conditions; $statement = WCF::getDB()->prepareStatement($sql); - $statement->execute(array( - WCF::getUser()->userID, - 1, - ModerationQueue::STATUS_DONE - )); + $statement->execute($conditions->getParameters()); $row = $statement->fetchArray(); $count = $row['count'];