Fix embedded object handling after editing comment responses
authorMatthias Schmidt <gravatronics@live.com>
Thu, 10 Jun 2021 05:51:43 +0000 (07:51 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Thu, 10 Jun 2021 05:51:43 +0000 (07:51 +0200)
wcfsetup/install/files/lib/data/comment/response/CommentResponseAction.class.php

index 7903550aefc0570b652043c6e8887d030a26e7e4..7015c445772a12a4072d8217db593563a5424325 100644 (file)
@@ -322,16 +322,14 @@ class CommentResponseAction extends AbstractDatabaseObjectAction
             'message' => $htmlInputProcessor->getHtml(),
         ];
 
-        $htmlInputProcessor->setObjectID($this->comment->getObjectID());
+        $htmlInputProcessor->setObjectID($this->response->getObjectID());
         $hasEmbeddedObjects = MessageEmbeddedObjectManager::getInstance()->registerObjects($htmlInputProcessor);
         if ($this->response->hasEmbeddedObjects != $hasEmbeddedObjects) {
             $data['hasEmbeddedObjects'] = $this->response->hasEmbeddedObjects ? 0 : 1;
         }
 
         (new self([$this->response], 'update', [
-            'data' => [
-                'message' => $htmlInputProcessor->getHtml(),
-            ],
+            'data' => $data,
         ]))->executeAction();
 
         $response = new CommentResponse($this->response->getObjectID());