From e2b06b7f34cb14e496a9615411a7868ee247bb45 Mon Sep 17 00:00:00 2001 From: Fabii547 Date: Sat, 18 Aug 2018 11:13:52 +0200 Subject: [PATCH] Fix UserProfileCommentResponseOwnerUserNotificationEvent::getLink() UserProfileCommentResponseOwnerUserNotificationEvent::getLink() now returns the correct link when using an event listener on fireEvent@wcf\system\user\notification\UserNotificationHandler Fix usage of the RuntimeCacheBuilder --- ...mmentResponseOwnerUserNotificationEvent.class.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/wcfsetup/install/files/lib/system/user/notification/event/UserProfileCommentResponseOwnerUserNotificationEvent.class.php b/wcfsetup/install/files/lib/system/user/notification/event/UserProfileCommentResponseOwnerUserNotificationEvent.class.php index 93099710ab..18e93b3f9e 100644 --- a/wcfsetup/install/files/lib/system/user/notification/event/UserProfileCommentResponseOwnerUserNotificationEvent.class.php +++ b/wcfsetup/install/files/lib/system/user/notification/event/UserProfileCommentResponseOwnerUserNotificationEvent.class.php @@ -6,7 +6,6 @@ use wcf\system\cache\runtime\UserProfileRuntimeCache; use wcf\system\email\Email; use wcf\system\request\LinkHandler; use wcf\system\user\notification\object\CommentResponseUserNotificationObject; -use wcf\system\WCF; /** * User notification event for profile's owner for comment responses. @@ -29,7 +28,10 @@ class UserProfileCommentResponseOwnerUserNotificationEvent extends AbstractShare */ protected function prepare() { CommentRuntimeCache::getInstance()->cacheObjectID($this->getUserNotificationObject()->commentID); - UserProfileRuntimeCache::getInstance()->cacheObjectID($this->additionalData['userID']); + UserProfileRuntimeCache::getInstance()->cacheObjectIDs([ + $this->additionalData['userID'], + $this->additionalData['objectID'] + ]); } /** @@ -112,7 +114,11 @@ class UserProfileCommentResponseOwnerUserNotificationEvent extends AbstractShare * @inheritDoc */ public function getLink() { - return LinkHandler::getInstance()->getLink('User', ['object' => WCF::getUser()], '#wall'); + return LinkHandler::getInstance()->getLink( + 'User', + ['object' => UserProfileRuntimeCache::getInstance()->getObject($this->additionalData['objectID'])], + '#wall' + ); } /** -- 2.20.1