Until now, the notifications were bound to the article object. However, the actual comments are bound to the article content object. This has now been corrected and the notification itself is now also bound to the article content object.
use wcf\data\user\UserProfile;
use wcf\system\cache\runtime\CommentRuntimeCache;
use wcf\system\cache\runtime\UserProfileRuntimeCache;
-use wcf\system\cache\runtime\ViewableArticleRuntimeCache;
+use wcf\system\cache\runtime\ViewableArticleContentRuntimeCache;
use wcf\system\comment\CommentHandler;
use wcf\system\email\Email;
use wcf\system\user\notification\object\CommentUserNotificationObject;
'author' => $this->author,
'authors' => array_values($authors),
'commentID' => $this->getUserNotificationObject()->commentID,
- 'article' => ViewableArticleRuntimeCache::getInstance()->getObject($this->additionalData['objectID']),
+ 'article' => ViewableArticleContentRuntimeCache::getInstance()->getObject($this->additionalData['objectID']),
'count' => $count,
'others' => $count - 1,
'guestTimesTriggered' => $this->notification->guestTimesTriggered,
return $this->getLanguage()->getDynamicVariable('wcf.user.notification.articleComment.responseOwner.message', [
'author' => $this->author,
'commentID' => $this->getUserNotificationObject()->commentID,
- 'article' => ViewableArticleRuntimeCache::getInstance()->getObject($this->additionalData['objectID']),
+ 'article' => ViewableArticleContentRuntimeCache::getInstance()->getObject($this->additionalData['objectID']),
'responseID' => $this->getUserNotificationObject()->responseID,
'commentAuthor' => $this->getCommentAuthorProfile()
]);
'application' => 'wcf',
'variables' => [
'commentID' => $this->getUserNotificationObject()->commentID,
- 'article' => ViewableArticleRuntimeCache::getInstance()->getObject($this->additionalData['objectID']),
+ 'article' => ViewableArticleContentRuntimeCache::getInstance()->getObject($this->additionalData['objectID']),
'languageVariablePrefix' => 'wcf.user.notification.articleComment.responseOwner',
'responseID' => $this->getUserNotificationObject()->responseID,
'commentAuthor' => $this->getCommentAuthorProfile(),
* @inheritDoc
*/
public function getLink() {
- return ViewableArticleRuntimeCache::getInstance()->getObject($this->additionalData['objectID'])->getLink() . '#comment'. $this->getUserNotificationObject()->commentID;
+ return ViewableArticleContentRuntimeCache::getInstance()->getObject($this->additionalData['objectID'])->getLink() . '#comment'. $this->getUserNotificationObject()->commentID .'/response'. $this->getUserNotificationObject()->responseID;
}
/**
*/
protected static function getTestCommentObjectData(UserProfile $recipient, UserProfile $author) {
return [
- 'objectID' => self::getTestArticle(self::createTestCategory(ArticleCategory::OBJECT_TYPE_NAME), $author)->articleID,
+ 'objectID' => self::getTestArticle(self::createTestCategory(ArticleCategory::OBJECT_TYPE_NAME), $author)->getArticleContent()->articleContentID,
'objectTypeID' => CommentHandler::getInstance()->getObjectTypeID('com.woltlab.wcf.articleComment')
];
}
use wcf\data\article\category\ArticleCategory;
use wcf\data\user\UserProfile;
use wcf\system\cache\runtime\CommentRuntimeCache;
-use wcf\system\cache\runtime\ViewableArticleRuntimeCache;
+use wcf\system\cache\runtime\ViewableArticleContentRuntimeCache;
use wcf\system\comment\CommentHandler;
use wcf\system\email\Email;
use wcf\system\user\notification\object\CommentUserNotificationObject;
'author' => $this->author,
'authors' => array_values($authors),
'commentID' => $this->getUserNotificationObject()->commentID,
- 'article' => ViewableArticleRuntimeCache::getInstance()->getObject($this->additionalData['objectID']),
+ 'article' => ViewableArticleContentRuntimeCache::getInstance()->getObject($this->additionalData['objectID']),
'count' => $count,
'others' => $count - 1,
'guestTimesTriggered' => $this->notification->guestTimesTriggered,
return $this->getLanguage()->getDynamicVariable('wcf.user.notification.articleComment.response.message', [
'author' => $this->author,
'commentID' => $this->getUserNotificationObject()->commentID,
- 'article' => ViewableArticleRuntimeCache::getInstance()->getObject($this->additionalData['objectID']),
+ 'article' => ViewableArticleContentRuntimeCache::getInstance()->getObject($this->additionalData['objectID']),
'responseID' => $this->getUserNotificationObject()->responseID
]);
}
'application' => 'wcf',
'variables' => [
'commentID' => $this->getUserNotificationObject()->commentID,
- 'article' => ViewableArticleRuntimeCache::getInstance()->getObject($this->additionalData['objectID']),
+ 'article' => ViewableArticleContentRuntimeCache::getInstance()->getObject($this->additionalData['objectID']),
'languageVariablePrefix' => 'wcf.user.notification.articleComment.response',
'responseID' => $this->getUserNotificationObject()->responseID
]
* @inheritDoc
*/
public function getLink() {
- return ViewableArticleRuntimeCache::getInstance()->getObject($this->additionalData['objectID'])->getLink() . '#comment'. $this->getUserNotificationObject()->commentID;
+ return ViewableArticleContentRuntimeCache::getInstance()->getObject($this->additionalData['objectID'])->getLink() . '#comment'. $this->getUserNotificationObject()->commentID .'/response'. $this->getUserNotificationObject()->responseID;
}
/**
*/
protected static function getTestCommentObjectData(UserProfile $recipient, UserProfile $author) {
return [
- 'objectID' => self::getTestArticle(self::createTestCategory(ArticleCategory::OBJECT_TYPE_NAME), $author)->articleID,
+ 'objectID' => self::getTestArticle(self::createTestCategory(ArticleCategory::OBJECT_TYPE_NAME), $author)->getArticleContent()->articleContentID,
'objectTypeID' => CommentHandler::getInstance()->getObjectTypeID('com.woltlab.wcf.articleComment')
];
}
namespace wcf\system\user\notification\event;
use wcf\data\article\category\ArticleCategory;
use wcf\data\user\UserProfile;
-use wcf\system\cache\runtime\ViewableArticleRuntimeCache;
+use wcf\system\cache\runtime\ViewableArticleContentRuntimeCache;
use wcf\system\comment\CommentHandler;
use wcf\system\user\notification\object\CommentUserNotificationObject;
* @inheritDoc
*/
protected function prepare() {
- ViewableArticleRuntimeCache::getInstance()->cacheObjectID($this->getUserNotificationObject()->objectID);
+ ViewableArticleContentRuntimeCache::getInstance()->cacheObjectID($this->getUserNotificationObject()->objectID);
}
/**
'author' => $this->author,
'authors' => array_values($authors),
'commentID' => $this->getUserNotificationObject()->commentID,
- 'article' => ViewableArticleRuntimeCache::getInstance()->getObject($this->getUserNotificationObject()->objectID),
+ 'article' => ViewableArticleContentRuntimeCache::getInstance()->getObject($this->getUserNotificationObject()->objectID),
'count' => $count,
'others' => $count - 1,
'guestTimesTriggered' => $this->notification->guestTimesTriggered
return $this->getLanguage()->getDynamicVariable('wcf.user.notification.articleComment.message', [
'author' => $this->author,
'commentID' => $this->getUserNotificationObject()->commentID,
- 'article' => ViewableArticleRuntimeCache::getInstance()->getObject($this->getUserNotificationObject()->objectID)
+ 'article' => ViewableArticleContentRuntimeCache::getInstance()->getObject($this->getUserNotificationObject()->objectID)
]);
}
'application' => 'wcf',
'variables' => [
'commentID' => $this->getUserNotificationObject()->commentID,
- 'article' => ViewableArticleRuntimeCache::getInstance()->getObject($this->getUserNotificationObject()->objectID),
+ 'article' => ViewableArticleContentRuntimeCache::getInstance()->getObject($this->getUserNotificationObject()->objectID),
'languageVariablePrefix' => 'wcf.user.notification.articleComment'
]
];
* @inheritDoc
*/
public function getLink() {
- return ViewableArticleRuntimeCache::getInstance()->getObject($this->getUserNotificationObject()->objectID)->getLink() . '#comment'. $this->getUserNotificationObject()->commentID;
+ return ViewableArticleContentRuntimeCache::getInstance()->getObject($this->getUserNotificationObject()->objectID)->getLink() . '#comment'. $this->getUserNotificationObject()->commentID;
}
/**
*/
protected static function getTestCommentObjectData(UserProfile $recipient, UserProfile $author) {
return [
- 'objectID' => self::getTestArticle(self::createTestCategory(ArticleCategory::OBJECT_TYPE_NAME), $author)->articleID,
+ 'objectID' => self::getTestArticle(self::createTestCategory(ArticleCategory::OBJECT_TYPE_NAME), $author)->getArticleContent()->articleContentID,
'objectTypeID' => CommentHandler::getInstance()->getObjectTypeID('com.woltlab.wcf.articleComment')
];
}