Fix missing caching of article in notifications about comment responses
authorMarcel Werk <burntime@woltlab.com>
Thu, 27 Apr 2023 14:08:39 +0000 (16:08 +0200)
committerMarcel Werk <burntime@woltlab.com>
Thu, 27 Apr 2023 14:08:39 +0000 (16:08 +0200)
wcfsetup/install/files/lib/system/user/notification/event/ArticleCommentResponseOwnerUserNotificationEvent.class.php
wcfsetup/install/files/lib/system/user/notification/event/ArticleCommentResponseUserNotificationEvent.class.php

index d4e42842cf5d53450b7f969bb1c23b249e87cf83..42b148990b448085aca894fd6ee1e22a8a01eec6 100644 (file)
@@ -22,6 +22,16 @@ class ArticleCommentResponseOwnerUserNotificationEvent extends AbstractCommentRe
     use TTestableCommentResponseUserNotificationEvent;
     use TTestableArticleCommentUserNotificationEvent;
 
+    /**
+     * @inheritDoc
+     */
+    protected function prepare()
+    {
+        parent::prepare();
+
+        ViewableArticleContentRuntimeCache::getInstance()->cacheObjectID($this->additionalData['objectID']);
+    }
+
     /**
      * @inheritDoc
      */
index c2df7ac315d49d73b495d5463b522ab90e351853..532fc7e637cb7e70d9761f1274e0a54a84b6d6ba 100644 (file)
@@ -2,10 +2,8 @@
 
 namespace wcf\system\user\notification\event;
 
-use wcf\system\cache\runtime\CommentRuntimeCache;
 use wcf\system\cache\runtime\ViewableArticleContentRuntimeCache;
 use wcf\system\email\Email;
-use wcf\system\user\notification\object\CommentResponseUserNotificationObject;
 
 /**
  * User notification event for article comment responses.
@@ -21,6 +19,16 @@ class ArticleCommentResponseUserNotificationEvent extends AbstractCommentRespons
     use TTestableCommentResponseUserNotificationEvent;
     use TTestableArticleCommentUserNotificationEvent;
 
+    /**
+     * @inheritDoc
+     */
+    protected function prepare()
+    {
+        parent::prepare();
+
+        ViewableArticleContentRuntimeCache::getInstance()->cacheObjectID($this->additionalData['objectID']);
+    }
+
     /**
      * @inheritDoc
      */