Force rebuilding response ids for comments
authorAlexander Ebert <ebert@woltlab.com>
Fri, 25 Aug 2017 11:32:32 +0000 (13:32 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Fri, 25 Aug 2017 11:32:32 +0000 (13:32 +0200)
Fixes #2391

wcfsetup/install/files/lib/system/worker/CommentRebuildDataWorker.class.php

index f57232826477b38761a4393c4fa7ab4cc3804de9..688c52168f85b93f6f6d60d9d69c675d33fd1ddf 100644 (file)
@@ -18,7 +18,7 @@ class CommentRebuildDataWorker extends AbstractRebuildDataWorker {
        /**
         * @inheritDoc
         */
-       protected $limit = 500;
+       protected $limit = 50;
        
        /**
         * @var HtmlInputProcessor
@@ -65,11 +65,16 @@ class CommentRebuildDataWorker extends AbstractRebuildDataWorker {
                WCF::getDB()->beginTransaction();
                /** @var Comment $comment */
                foreach ($this->objectList as $comment) {
+                       $commentEditor = new CommentEditor($comment);
+                       
+                       $commentEditor->updateResponseIDs();
+                       $commentEditor->updateUnfilteredResponseIDs();
+                       
                        // update message
                        if (!$comment->enableHtml) {
                                $this->getHtmlInputProcessor()->process($comment->message, 'com.woltlab.wcf.comment', $comment->commentID, true);
                                
-                               (new CommentEditor($comment))->update([
+                               $commentEditor->update([
                                        'message' => $this->getHtmlInputProcessor()->getHtml(),
                                        'enableHtml' => 1
                                ]);