Fix stacking of article reactions
authorMatthias Schmidt <gravatronics@live.com>
Thu, 21 May 2020 13:55:58 +0000 (15:55 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Thu, 21 May 2020 13:55:58 +0000 (15:55 +0200)
See #3269

wcfsetup/install/files/lib/data/article/LikeableArticle.class.php
wcfsetup/install/files/lib/system/user/notification/event/ArticleLikeUserNotificationEvent.class.php

index 5b6f0ea1498e3550377c0574ff6780cb884c5d70..c0be84f5130afb808cfeaee718c815848f8e2903 100644 (file)
@@ -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]
                        );
                }
        }
index 85644c1d7c20dfcec0ad41fdf1a182427935e99a..7b31e084ed71f8ac1373fa23cbab8a1c706d8ca2 100644 (file)
@@ -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