Add the function `loadEmbeddedObjects()` to load the embedded objects for `saveQuote...
authorOlaf Braun <info@braun-development.de>
Fri, 23 Aug 2024 13:37:39 +0000 (15:37 +0200)
committerOlaf Braun <info@braun-development.de>
Fri, 23 Aug 2024 13:37:39 +0000 (15:37 +0200)
files/lib/data/conversation/message/ConversationMessageAction.class.php

index 24a26bd0ac9c20472464f5ef7e8dbbfdcc7d6a01..9ea1de04f9b3f18e917a1499b367f65649643b72 100644 (file)
@@ -607,10 +607,7 @@ class ConversationMessageAction extends AbstractDatabaseObjectAction implements
         }
     }
 
-    /**
-     * @inheritDoc
-     */
-    public function saveFullQuote()
+    private function loadEmbeddedObjects(): void
     {
         if ($this->message->hasEmbeddedObjects) {
             ObjectTypeCache::getInstance()
@@ -622,6 +619,14 @@ class ConversationMessageAction extends AbstractDatabaseObjectAction implements
                 [$this->message->messageID]
             );
         }
+    }
+
+    /**
+     * @inheritDoc
+     */
+    public function saveFullQuote()
+    {
+        $this->loadEmbeddedObjects();
 
         $quoteID = MessageQuoteManager::getInstance()->addQuote(
             'com.woltlab.wcf.conversation.message',
@@ -674,6 +679,8 @@ class ConversationMessageAction extends AbstractDatabaseObjectAction implements
      */
     public function saveQuote()
     {
+        $this->loadEmbeddedObjects();
+
         $quoteID = MessageQuoteManager::getInstance()->addQuote(
             'com.woltlab.wcf.conversation.message',
             $this->message->conversationID,