Suppress user activity events when articles have been disabled
authorAlexander Ebert <ebert@woltlab.com>
Mon, 16 Jan 2023 15:14:55 +0000 (16:14 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Mon, 16 Jan 2023 15:14:55 +0000 (16:14 +0100)
See https://www.woltlab.com/community/thread/298375-letzte-aktivit%C3%A4ten-nach-modul-deaktivierung/

wcfsetup/install/files/lib/system/user/activity/event/ArticleCommentResponseUserActivityEvent.class.php
wcfsetup/install/files/lib/system/user/activity/event/ArticleCommentUserActivityEvent.class.php
wcfsetup/install/files/lib/system/user/activity/event/ArticleUserActivityEvent.class.php
wcfsetup/install/files/lib/system/user/activity/event/LikeableArticleUserActivityEvent.class.php

index b19cbc4d6ab799532a2791110dd978e629a3d20f..998d8267aa7c8424929e944698cb0b113b1dfe11 100644 (file)
@@ -24,6 +24,10 @@ class ArticleCommentResponseUserActivityEvent extends SingletonFactory implement
      */
     public function prepare(array $events)
     {
+        if (!\MODULE_ARTICLE) {
+            return;
+        }
+
         $this->readResponseData($events);
 
         // fetch articles
index 8bdaefda08b9fb447df5ab70863b48451d096c4f..267a0647b5aba5dd0c066f3d7f7078a8744b3176 100644 (file)
@@ -23,6 +23,10 @@ class ArticleCommentUserActivityEvent extends SingletonFactory implements IUserA
      */
     public function prepare(array $events)
     {
+        if (!\MODULE_ARTICLE) {
+            return;
+        }
+
         $commentIDs = [];
         foreach ($events as $event) {
             $commentIDs[] = $event->objectID;
index e44acdf2de6aa3b459c4187c6dc2cd0bbd70592d..9e0d2e856c1d7ed31db4be6c92b22a1851d455ad 100644 (file)
@@ -21,6 +21,10 @@ class ArticleUserActivityEvent extends SingletonFactory implements IUserActivity
      */
     public function prepare(array $events)
     {
+        if (!\MODULE_ARTICLE) {
+            return;
+        }
+
         $objectIDs = [];
         foreach ($events as $event) {
             $objectIDs[] = $event->objectID;
index 0a868a711c96f6d009f6edd12e391d4f03915434..0c8298b0a03244b1be46dc458c4ac7cb66885dbb 100644 (file)
@@ -22,6 +22,10 @@ class LikeableArticleUserActivityEvent extends SingletonFactory implements IUser
      */
     public function prepare(array $events)
     {
+        if (!\MODULE_ARTICLE) {
+            return;
+        }
+
         $articleIDs = [];
         foreach ($events as $event) {
             $articleIDs[] = $event->objectID;