User online lookup for the article page was using the article id instead of the conte...
authorMarcel Werk <burntime@woltlab.com>
Fri, 27 Mar 2020 12:30:38 +0000 (13:30 +0100)
committerMarcel Werk <burntime@woltlab.com>
Fri, 27 Mar 2020 12:30:38 +0000 (13:30 +0100)
wcfsetup/install/files/lib/system/page/handler/ArticlePageHandler.class.php

index 29c95c245851eda74a60aece8a5e5cca5b63b1c8..baf36b686a9078e2d57b2dc264f627a464699bda 100644 (file)
@@ -1,5 +1,6 @@
 <?php
 namespace wcf\system\page\handler;
+use wcf\data\article\content\ViewableArticleContent;
 use wcf\data\article\ViewableArticleList;
 use wcf\data\page\Page;
 use wcf\data\user\online\UserOnline;
@@ -74,21 +75,17 @@ class ArticlePageHandler extends AbstractLookupPageHandler implements IOnlineLoc
                if ($user->pageObjectID === null) {
                        return '';
                }
-               
-               $article = ViewableArticleRuntimeCache::getInstance()->getObject($user->pageObjectID);
-               if ($article === null || !$article->canRead()) {
+                               
+               $content = ViewableArticleContent::getArticleContent($user->pageObjectID);
+               if ($content === null || !$content->getArticle()->canRead()) {
                        return '';
                }
                
-               return WCF::getLanguage()->getDynamicVariable('wcf.page.onlineLocation.'.$page->identifier, ['article' => $article]);
+               return WCF::getLanguage()->getDynamicVariable('wcf.page.onlineLocation.'.$page->identifier, ['article' => $content]);
        }
        
        /**
         * @inheritDoc
         */
-       public function prepareOnlineLocation(/** @noinspection PhpUnusedParameterInspection */Page $page, UserOnline $user) {
-               if ($user->pageObjectID !== null) {
-                       ViewableArticleRuntimeCache::getInstance()->cacheObjectID($user->pageObjectID);
-               }
-       }
+       public function prepareOnlineLocation(/** @noinspection PhpUnusedParameterInspection */Page $page, UserOnline $user) {}
 }