Delete moderation queue comment notifications if the moderation queue object has...
authorCyperghost <olaf_schmitz_1@t-online.de>
Fri, 8 Mar 2024 10:28:37 +0000 (11:28 +0100)
committerCyperghost <olaf_schmitz_1@t-online.de>
Fri, 8 Mar 2024 10:28:37 +0000 (11:28 +0100)
wcfsetup/install/files/lib/system/user/notification/event/ModerationQueueCommentUserNotificationEvent.class.php

index d207b4f45b624a46c3d20b9b1d804b8a129e9313..41cf6597a0ffb067a8976c53d4e2fb22deaace43 100644 (file)
@@ -55,6 +55,9 @@ class ModerationQueueCommentUserNotificationEvent extends AbstractCommentUserNot
         if (!WCF::getSession()->getPermission('mod.general.canUseModeration')) {
             return false;
         }
+        if (!$this->moderationQueue->queueID) {
+            return false;
+        }
 
         return $this->moderationQueue->canEdit();
     }
@@ -143,6 +146,9 @@ class ModerationQueueCommentUserNotificationEvent extends AbstractCommentUserNot
         $this->moderationQueue = new ViewableModerationQueue(
             new ModerationQueue($this->getUserNotificationObject()->objectID)
         );
+        if (!$this->moderationQueue->queueID) {
+            return;
+        }
 
         /** @var IModerationQueueHandler $moderationHandler */
         $moderationHandler = ObjectTypeCache::getInstance()