Updated message context for html processors
authorAlexander Ebert <ebert@woltlab.com>
Sun, 26 Jun 2016 15:23:31 +0000 (17:23 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Sun, 26 Jun 2016 15:23:31 +0000 (17:23 +0200)
files/lib/data/conversation/message/ConversationMessageAction.class.php
files/lib/system/worker/ConversationMessageRebuildDataWorker.class.php

index 63edb387acb48a46b5ed0ca12c014d43526973c4..6d7a6f7c6bb0dce14861327a7881e25ee298334d 100644 (file)
@@ -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)]);
                                        }
                                }
index 70dead5163b03ad2c8f8cebac4a05f192e42dcb9..65c6ef00307b3c97b1b09d4e47ef82ab573b1005 100644 (file)
@@ -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);
                }