Automatically set active message for embedded objects
authorAlexander Ebert <ebert@woltlab.com>
Sun, 10 Jul 2016 08:38:57 +0000 (10:38 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Sun, 10 Jul 2016 08:39:03 +0000 (10:39 +0200)
wcfsetup/install/files/lib/data/article/content/ArticleContent.class.php
wcfsetup/install/files/lib/data/box/Box.class.php
wcfsetup/install/files/lib/data/page/content/PageContent.class.php
wcfsetup/install/files/lib/system/html/output/HtmlOutputProcessor.class.php

index bbb76f779f1233dd908cd60fcd23564274addc9a..1f30639fa3d61aef91ea5146ad119523723b8390 100644 (file)
@@ -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);
                
index 39b0d0fb762edce0006e56196a2b886d045c47d3..f6511043f55e8e4813ff55da28570600003af32b 100644 (file)
@@ -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);
                                
index e106ef238ab677162a2ab3224af4919fcf37ce68..aa1104e1b32638a543e15a5785d2cb8954e64c72 100644 (file)
@@ -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();
index 4e0584929872586cc384286c9f1609742f376e4c..78e1598d164cd5e63d7debc39db5fe41ba983188 100644 (file)
@@ -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);
        }
        
        /**