Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

use wcf\system\WCF;

// Remove orphaned entries associated with `messageID=0`.
$sql = "DELETE FROM wcf1_message_embedded_object WHERE messageID = ?";
$statement = WCF::getDB()->prepare($sql);
$statement->execute([0]);
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ public function registerObjects(HtmlInputProcessor $htmlInputProcessor, $isBulk
$messageObjectTypeID = $context['objectTypeID'];
$messageID = $context['objectID'];

if (!$messageID) {
throw new \BadMethodCallException("No 'messageID' was set.");
}

// delete existing assignments
if ($removeExistingObjects) {
if ($isBulk) {
Expand Down Expand Up @@ -195,6 +199,10 @@ public function commitBulkOperation()
*/
public function registerSimpleObjects($messageObjectType, $messageID, array $embeddedContent)
{
if (!$messageID) {
throw new \BadMethodCallException("No 'messageID' was given.");
}

$messageObjectTypeID = ObjectTypeCache::getInstance()
->getObjectTypeIDByName('com.woltlab.wcf.message', $messageObjectType);

Expand Down
Loading