From dbde1b1b477e3db37363dc4ebc98826c927b8258 Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Thu, 21 May 2020 15:55:58 +0200 Subject: [PATCH] Fix stacking of article reactions See #3269 --- .../files/lib/data/article/LikeableArticle.class.php | 3 ++- .../event/ArticleLikeUserNotificationEvent.class.php | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/wcfsetup/install/files/lib/data/article/LikeableArticle.class.php b/wcfsetup/install/files/lib/data/article/LikeableArticle.class.php index 5b6f0ea149..c0be84f513 100644 --- a/wcfsetup/install/files/lib/data/article/LikeableArticle.class.php +++ b/wcfsetup/install/files/lib/data/article/LikeableArticle.class.php @@ -81,7 +81,8 @@ class LikeableArticle extends AbstractLikeObject implements IReactionObject { 'like', 'com.woltlab.wcf.likeableArticle.notification', $notificationObject, - [$this->getDecoratedObject()->userID] + [$this->getDecoratedObject()->userID], + ['objectID' => $this->getDecoratedObject()->entryID] ); } } 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 85644c1d7c..7b31e084ed 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 @@ -105,6 +105,14 @@ class ArticleLikeUserNotificationEvent extends AbstractSharedUserNotificationEve return false; } + /** @noinspection PhpMissingParentCallCommonInspection */ + /** + * @inheritDoc + */ + public function getEventHash() { + return sha1($this->eventID . '-' . $this->additionalData['objectID']); + } + /** @noinspection PhpMissingParentCallCommonInspection */ /** * @inheritDoc -- 2.20.1