Hide article-related notification events if articles are disabled
authorMatthias Schmidt <gravatronics@live.com>
Sun, 3 Jan 2021 16:23:09 +0000 (17:23 +0100)
committerMatthias Schmidt <gravatronics@live.com>
Sun, 3 Jan 2021 16:23:09 +0000 (17:23 +0100)
com.woltlab.wcf/userNotificationEvent.xml
wcfsetup/install/files/lib/system/user/notification/event/ArticleLikeUserNotificationEvent.class.php

index 5d3d3b1e2c1139ac2975878b34c79bd320f50941..e278e90ec8f14f8ded4805b1938d7a00d1734994 100644 (file)
                        <name>like</name>
                        <objecttype>com.woltlab.wcf.likeableArticle.notification</objecttype>
                        <classname>wcf\system\user\notification\event\ArticleLikeUserNotificationEvent</classname>
-                       <options>module_like</options>
                        <preset>1</preset>
                </event>
                
index 7b31e084ed71f8ac1373fa23cbab8a1c706d8ca2..e88d55c2852304ae24e7e83a5dc74f7fba3d142e 100644 (file)
@@ -130,6 +130,17 @@ class ArticleLikeUserNotificationEvent extends AbstractSharedUserNotificationEve
                return true;
        }
        
+       /**
+        * @inheritDoc
+        */
+       public function isVisible() {
+               if (!MODULE_ARTICLE || !MODULE_LIKE) {
+                       return false;
+               }
+               
+               return parent::isVisible();
+       }
+       
        /**
         * @inheritDoc
         */