From b5f54a71f9f2978786f1fa9dba2c0ef9cf40c6b0 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Sun, 30 Nov 2014 16:18:46 +0100 Subject: [PATCH] Properly assigning a language id for like user activity events --- wcfsetup/install/files/lib/data/like/LikeAction.class.php | 2 +- .../lib/data/like/object/AbstractLikeObject.class.php | 7 +++++++ .../files/lib/data/like/object/ILikeObject.class.php | 7 +++++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/wcfsetup/install/files/lib/data/like/LikeAction.class.php b/wcfsetup/install/files/lib/data/like/LikeAction.class.php index ad01240531..97f3b4f8bb 100644 --- a/wcfsetup/install/files/lib/data/like/LikeAction.class.php +++ b/wcfsetup/install/files/lib/data/like/LikeAction.class.php @@ -163,7 +163,7 @@ class LikeAction extends AbstractDatabaseObjectAction implements IGroupedUserLis // handle activity event if (UserActivityEventHandler::getInstance()->getObjectTypeID($this->objectType->objectType.'.recentActivityEvent')) { if ($likeData['data']['liked'] == 1) { - UserActivityEventHandler::getInstance()->fireEvent($this->objectType->objectType.'.recentActivityEvent', $this->parameters['data']['objectID']); + UserActivityEventHandler::getInstance()->fireEvent($this->objectType->objectType.'.recentActivityEvent', $this->parameters['data']['objectID'], $this->likeableObject->getLanguageID()); } else { UserActivityEventHandler::getInstance()->removeEvents($this->objectType->objectType.'.recentActivityEvent', array($this->parameters['data']['objectID'])); diff --git a/wcfsetup/install/files/lib/data/like/object/AbstractLikeObject.class.php b/wcfsetup/install/files/lib/data/like/object/AbstractLikeObject.class.php index 49808ee068..ec5421abba 100644 --- a/wcfsetup/install/files/lib/data/like/object/AbstractLikeObject.class.php +++ b/wcfsetup/install/files/lib/data/like/object/AbstractLikeObject.class.php @@ -51,4 +51,11 @@ abstract class AbstractLikeObject extends DatabaseObjectDecorator implements ILi public function sendNotification(Like $like) { // individual implementations can override this method to provide notifications } + + /** + * @see \wcf\data\like\object\ILikeObject::getLanguageID() + */ + public function getLanguageID() { + return null; + } } diff --git a/wcfsetup/install/files/lib/data/like/object/ILikeObject.class.php b/wcfsetup/install/files/lib/data/like/object/ILikeObject.class.php index dd8a9498da..018189f874 100644 --- a/wcfsetup/install/files/lib/data/like/object/ILikeObject.class.php +++ b/wcfsetup/install/files/lib/data/like/object/ILikeObject.class.php @@ -64,4 +64,11 @@ interface ILikeObject extends IDatabaseObjectProcessor, ITitledObject { * @param \wcf\data\like\Like $like */ public function sendNotification(Like $like); + + /** + * Returns the language id of this object or its parent. + * + * @return integer + */ + public function getLanguageID(); } -- 2.20.1