From 7a6878d3639b42757557ac6daed8b3487bfa917e Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Fri, 7 May 2021 12:07:57 +0200 Subject: [PATCH] Fix deleting content from moderation activation page --- .../ModerationQueueActivationAction.class.php | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/wcfsetup/install/files/lib/data/moderation/queue/ModerationQueueActivationAction.class.php b/wcfsetup/install/files/lib/data/moderation/queue/ModerationQueueActivationAction.class.php index 3d02f8963f..35d184d085 100644 --- a/wcfsetup/install/files/lib/data/moderation/queue/ModerationQueueActivationAction.class.php +++ b/wcfsetup/install/files/lib/data/moderation/queue/ModerationQueueActivationAction.class.php @@ -75,8 +75,10 @@ class ModerationQueueActivationAction extends ModerationQueueAction $this->readString('message', true); $this->validateEnableContent(); - if (!ModerationQueueActivationManager::getInstance()->canRemoveContent($this->queue->getDecoratedObject())) { - throw new PermissionDeniedException(); + foreach ($this->getObjects() as $moderationQueueEditor) { + if (!ModerationQueueActivationManager::getInstance()->canRemoveContent($moderationQueueEditor->getDecoratedObject())) { + throw new PermissionDeniedException(); + } } } @@ -85,13 +87,14 @@ class ModerationQueueActivationAction extends ModerationQueueAction */ public function removeContent() { - // mark content as deleted - ModerationQueueActivationManager::getInstance()->removeContent( - $this->queue->getDecoratedObject(), - $this->parameters['message'] - ); + foreach ($this->getObjects() as $moderationQueueEditor) { + ModerationQueueActivationManager::getInstance()->removeContent( + $moderationQueueEditor->getDecoratedObject(), + $this->parameters['message'] + ); - $this->queue->markAsRejected(); + $moderationQueueEditor->markAsRejected(); + } $this->unmarkItems(); } -- 2.20.1