From af118defb492d81d1e7ab21ea5eb6d374fa32d55 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Sun, 10 Jul 2016 10:38:57 +0200 Subject: [PATCH] Automatically set active message for embedded objects --- .../files/lib/data/article/content/ArticleContent.class.php | 3 --- wcfsetup/install/files/lib/data/box/Box.class.php | 3 --- .../install/files/lib/data/page/content/PageContent.class.php | 2 -- .../files/lib/system/html/output/HtmlOutputProcessor.class.php | 3 +++ 4 files changed, 3 insertions(+), 8 deletions(-) diff --git a/wcfsetup/install/files/lib/data/article/content/ArticleContent.class.php b/wcfsetup/install/files/lib/data/article/content/ArticleContent.class.php index bbb76f779f..1f30639fa3 100644 --- a/wcfsetup/install/files/lib/data/article/content/ArticleContent.class.php +++ b/wcfsetup/install/files/lib/data/article/content/ArticleContent.class.php @@ -93,9 +93,6 @@ class ArticleContent extends DatabaseObject implements ILinkableObject, IRouteCo * @return string */ public function getFormattedContent() { - // assign embedded objects - MessageEmbeddedObjectManager::getInstance()->setActiveMessage('com.woltlab.wcf.article.content', $this->articleContentID); - $processor = new HtmlOutputProcessor(); $processor->process($this->content, 'com.woltlab.wcf.article.content', $this->articleContentID); diff --git a/wcfsetup/install/files/lib/data/box/Box.class.php b/wcfsetup/install/files/lib/data/box/Box.class.php index 39b0d0fb76..f6511043f5 100644 --- a/wcfsetup/install/files/lib/data/box/Box.class.php +++ b/wcfsetup/install/files/lib/data/box/Box.class.php @@ -238,9 +238,6 @@ class Box extends DatabaseObject { if ($boxContent !== null) { if ($this->boxType == 'text') { - // assign embedded objects - MessageEmbeddedObjectManager::getInstance()->setActiveMessage('com.woltlab.wcf.box.content', $boxContent->boxContentID); - $processor = new HtmlOutputProcessor(); $processor->process($boxContent->content, 'com.woltlab.wcf.box.content', $boxContent->boxContentID); diff --git a/wcfsetup/install/files/lib/data/page/content/PageContent.class.php b/wcfsetup/install/files/lib/data/page/content/PageContent.class.php index e106ef238a..aa1104e1b3 100644 --- a/wcfsetup/install/files/lib/data/page/content/PageContent.class.php +++ b/wcfsetup/install/files/lib/data/page/content/PageContent.class.php @@ -43,8 +43,6 @@ class PageContent extends DatabaseObject { * @return string */ public function getFormattedContent() { - // assign embedded objects - MessageEmbeddedObjectManager::getInstance()->setActiveMessage('com.woltlab.wcf.page.content', $this->pageContentID); MessageEmbeddedObjectManager::getInstance()->loadObjects('com.woltlab.wcf.page.content', [$this->pageContentID]); $processor = new HtmlOutputProcessor(); diff --git a/wcfsetup/install/files/lib/system/html/output/HtmlOutputProcessor.class.php b/wcfsetup/install/files/lib/system/html/output/HtmlOutputProcessor.class.php index 4e05849298..78e1598d16 100644 --- a/wcfsetup/install/files/lib/system/html/output/HtmlOutputProcessor.class.php +++ b/wcfsetup/install/files/lib/system/html/output/HtmlOutputProcessor.class.php @@ -2,6 +2,7 @@ namespace wcf\system\html\output; use wcf\system\html\output\node\HtmlOutputNodeProcessor; use wcf\system\html\AbstractHtmlProcessor; +use wcf\system\message\embedded\object\MessageEmbeddedObjectManager; /** * Processes stored HTML for final display. @@ -71,6 +72,8 @@ class HtmlOutputProcessor extends AbstractHtmlProcessor { } parent::setContext($objectType, $objectID); + + MessageEmbeddedObjectManager::getInstance()->setActiveMessage($objectType, $objectID); } /** -- 2.20.1