From a94cad7f748e8d45238d28245d9a94ceea515543 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Sun, 26 Jun 2016 17:23:31 +0200 Subject: [PATCH] Updated message context for html processors --- .../conversation/message/ConversationMessageAction.class.php | 4 ++-- .../worker/ConversationMessageRebuildDataWorker.class.php | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/files/lib/data/conversation/message/ConversationMessageAction.class.php b/files/lib/data/conversation/message/ConversationMessageAction.class.php index 63edb38..6d7a6f7 100644 --- a/files/lib/data/conversation/message/ConversationMessageAction.class.php +++ b/files/lib/data/conversation/message/ConversationMessageAction.class.php @@ -154,7 +154,7 @@ class ConversationMessageAction extends AbstractDatabaseObjectAction implements // save embedded objects if (!empty($this->parameters['htmlInputProcessor'])) { - if (MessageEmbeddedObjectManager::getInstance()->registerObjects($this->parameters['htmlInputProcessor'], 'com.woltlab.wcf.conversation.message', $message->messageID)) { + if (MessageEmbeddedObjectManager::getInstance()->registerObjects($this->parameters['htmlInputProcessor'])) { $messageEditor->update(['hasEmbeddedObjects' => 1]); } } @@ -192,7 +192,7 @@ class ConversationMessageAction extends AbstractDatabaseObjectAction implements SearchIndexManager::getInstance()->update('com.woltlab.wcf.conversation.message', $message->messageID, $this->parameters['data']['message'], ($conversation->firstMessageID == $message->messageID ? $conversation->subject : ''), $message->time, $message->userID, $message->username); if (!empty($this->parameters['htmlInputProcessor'])) { - if ($message->hasEmbeddedObjects != MessageEmbeddedObjectManager::getInstance()->registerObjects($this->parameters['htmlInputProcessor'], 'com.woltlab.wcf.conversation.message', $message->messageID)) { + if ($message->hasEmbeddedObjects != MessageEmbeddedObjectManager::getInstance()->registerObjects($this->parameters['htmlInputProcessor'])) { $message->update(['hasEmbeddedObjects' => ($message->hasEmbeddedObjects ? 0 : 1)]); } } diff --git a/files/lib/system/worker/ConversationMessageRebuildDataWorker.class.php b/files/lib/system/worker/ConversationMessageRebuildDataWorker.class.php index 70dead5..65c6ef0 100644 --- a/files/lib/system/worker/ConversationMessageRebuildDataWorker.class.php +++ b/files/lib/system/worker/ConversationMessageRebuildDataWorker.class.php @@ -3,6 +3,7 @@ namespace wcf\system\worker; use wcf\data\conversation\message\ConversationMessageEditor; use wcf\data\conversation\message\ConversationMessageList; use wcf\data\object\type\ObjectTypeCache; +use wcf\system\exception\SystemException; use wcf\system\message\embedded\object\MessageEmbeddedObjectManager; use wcf\system\search\SearchIndexManager; use wcf\system\WCF; @@ -81,7 +82,8 @@ class ConversationMessageRebuildDataWorker extends AbstractRebuildDataWorker { $data['attachments'] = $row['attachments']; // update embedded objects - $data['hasEmbeddedObjects'] = (MessageEmbeddedObjectManager::getInstance()->registerObjects('com.woltlab.wcf.conversation.message', $message->messageID, $message->message) ? 1 : 0); + throw new SystemException("TODO: we need the html input processor here"); + $data['hasEmbeddedObjects'] = (MessageEmbeddedObjectManager::getInstance()->registerObjects('com.woltlab.wcf.conversation.message') ? 1 : 0); $editor->update($data); } -- 2.20.1