Load embedded content before the email text is processed.
authorCyperghost <olaf_schmitz_1@t-online.de>
Wed, 11 Sep 2024 10:29:05 +0000 (12:29 +0200)
committerCyperghost <olaf_schmitz_1@t-online.de>
Wed, 11 Sep 2024 10:29:05 +0000 (12:29 +0200)
wcfsetup/install/files/lib/data/article/content/ArticleContent.class.php
wcfsetup/install/files/lib/data/comment/Comment.class.php
wcfsetup/install/files/lib/data/comment/response/CommentResponse.class.php

index d079ffbd2ea9b425e69dd975a640fb517550f9e9..43b52731101e61a0476971f2779d61372f36b3d8 100644 (file)
@@ -8,6 +8,7 @@ use wcf\data\ILinkableObject;
 use wcf\data\language\Language;
 use wcf\system\html\output\HtmlOutputProcessor;
 use wcf\system\language\LanguageFactory;
+use wcf\system\message\embedded\object\MessageEmbeddedObjectManager;
 use wcf\system\request\IRouteController;
 use wcf\system\request\LinkHandler;
 use wcf\system\WCF;
@@ -168,6 +169,13 @@ class ArticleContent extends DatabaseObject implements ILinkableObject, IRouteCo
      */
     public function getMailText($mimeType = 'text/plain')
     {
+        if ($this->hasEmbeddedObjects) {
+            MessageEmbeddedObjectManager::getInstance()->loadObjects(
+                'com.woltlab.wcf.article.content',
+                [$this->articleContentID]
+            );
+        }
+
         switch ($mimeType) {
             case 'text/plain':
                 $processor = new HtmlOutputProcessor();
index c6282e1a0bbc635693e01ad1e4ffff698b20e114..eee827575484a43bde15692654c19388b8559e46 100644 (file)
@@ -8,6 +8,7 @@ use wcf\data\TUserContent;
 use wcf\system\comment\CommentHandler;
 use wcf\system\comment\manager\ICommentManager;
 use wcf\system\html\output\HtmlOutputProcessor;
+use wcf\system\message\embedded\object\MessageEmbeddedObjectManager;
 use wcf\util\StringUtil;
 
 /**
@@ -119,6 +120,13 @@ class Comment extends DatabaseObject implements IMessage
      */
     public function getMailText($mimeType = 'text/plain')
     {
+        if ($this->hasEmbeddedObjects) {
+            MessageEmbeddedObjectManager::getInstance()->loadObjects(
+                'com.woltlab.wcf.comment',
+                [$this->commentID]
+            );
+        }
+
         switch ($mimeType) {
             case 'text/plain':
                 return $this->getPlainTextMessage();
index d515db8a7143098f373b7d489588dcd96bbf764c..a9d64d1fd62a1d971382b0c71c038062cfe0fae9 100644 (file)
@@ -9,6 +9,7 @@ use wcf\data\TUserContent;
 use wcf\system\comment\CommentHandler;
 use wcf\system\comment\manager\ICommentManager;
 use wcf\system\html\output\HtmlOutputProcessor;
+use wcf\system\message\embedded\object\MessageEmbeddedObjectManager;
 use wcf\util\StringUtil;
 
 /**
@@ -83,6 +84,13 @@ class CommentResponse extends DatabaseObject implements IMessage
      */
     public function getMailText($mimeType = 'text/plain')
     {
+        if ($this->hasEmbeddedObjects) {
+            MessageEmbeddedObjectManager::getInstance()->loadObjects(
+                'com.woltlab.wcf.comment.response',
+                [$this->responseID]
+            );
+        }
+
         switch ($mimeType) {
             case 'text/plain':
                 return $this->getPlainTextMessage();