From 09ecea3dbd57fb14ad1976d11f4fa34ca7595806 Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Sun, 3 Jan 2021 17:23:09 +0100 Subject: [PATCH] Hide article-related notification events if articles are disabled --- com.woltlab.wcf/userNotificationEvent.xml | 1 - .../event/ArticleLikeUserNotificationEvent.class.php | 11 +++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/com.woltlab.wcf/userNotificationEvent.xml b/com.woltlab.wcf/userNotificationEvent.xml index 5d3d3b1e2c..e278e90ec8 100644 --- a/com.woltlab.wcf/userNotificationEvent.xml +++ b/com.woltlab.wcf/userNotificationEvent.xml @@ -122,7 +122,6 @@ like com.woltlab.wcf.likeableArticle.notification wcf\system\user\notification\event\ArticleLikeUserNotificationEvent - module_like 1 diff --git a/wcfsetup/install/files/lib/system/user/notification/event/ArticleLikeUserNotificationEvent.class.php b/wcfsetup/install/files/lib/system/user/notification/event/ArticleLikeUserNotificationEvent.class.php index 7b31e084ed..e88d55c285 100644 --- a/wcfsetup/install/files/lib/system/user/notification/event/ArticleLikeUserNotificationEvent.class.php +++ b/wcfsetup/install/files/lib/system/user/notification/event/ArticleLikeUserNotificationEvent.class.php @@ -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 */ -- 2.20.1