From a6409bb3e655415758e829a31bd9ddf58afd1bd8 Mon Sep 17 00:00:00 2001 From: Marcel Werk Date: Sat, 8 Oct 2016 23:23:51 +0200 Subject: [PATCH] Added missing update of embedded objects --- .../worker/ArticleRebuildDataWorker.class.php | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/wcfsetup/install/files/lib/system/worker/ArticleRebuildDataWorker.class.php b/wcfsetup/install/files/lib/system/worker/ArticleRebuildDataWorker.class.php index a8e4891f5a..bd0e110b1e 100644 --- a/wcfsetup/install/files/lib/system/worker/ArticleRebuildDataWorker.class.php +++ b/wcfsetup/install/files/lib/system/worker/ArticleRebuildDataWorker.class.php @@ -1,10 +1,13 @@ languageID, $articleContent->teaser ); + + // update embedded objects + $this->getHtmlInputProcessor()->processEmbeddedContent($articleContent->content, 'com.woltlab.wcf.article.content', $articleContent->articleContentID); + + $hasEmbeddedObjects = 0; + if (MessageEmbeddedObjectManager::getInstance()->registerObjects($this->getHtmlInputProcessor())) { + $hasEmbeddedObjects = 1; + } + + if ($hasEmbeddedObjects != $articleContent->hasEmbeddedObjects) { + $articleContentEditor = new ArticleContentEditor($articleContent); + $articleContentEditor->update(['hasEmbeddedObjects' => $hasEmbeddedObjects]); + } } // fetch cumulative likes @@ -114,4 +135,15 @@ class ArticleRebuildDataWorker extends AbstractRebuildDataWorker { $editor->update($data); } } + + /** + * @return HtmlInputProcessor + */ + protected function getHtmlInputProcessor() { + if ($this->htmlInputProcessor === null) { + $this->htmlInputProcessor = new HtmlInputProcessor(); + } + + return $this->htmlInputProcessor; + } } -- 2.20.1