Fixed issue in embedded object manager
authorMarcel Werk <burntime@woltlab.com>
Mon, 17 Oct 2016 21:29:02 +0000 (23:29 +0200)
committerMarcel Werk <burntime@woltlab.com>
Mon, 17 Oct 2016 21:29:09 +0000 (23:29 +0200)
wcfsetup/install/files/lib/system/message/embedded/object/MessageEmbeddedObjectManager.class.php

index c378588cb753e3ea818991d84a8ed17d085cb009..d464ebcddc40b9d1964e23d1527cc7ef22e7aff2 100644 (file)
@@ -170,15 +170,12 @@ class MessageEmbeddedObjectManager extends SingletonFactory {
                $statement->execute($conditionBuilder->getParameters());
                $embeddedObjects = [];
                while ($row = $statement->fetchArray()) {
-                       if (isset($this->embeddedObjects[$row['embeddedObjectTypeID']][$row['embeddedObjectID']])) {
-                               // embedded object already loaded
-                               continue;
+                       if (!isset($this->embeddedObjects[$row['embeddedObjectTypeID']][$row['embeddedObjectID']])) {
+                               // group objects by object type
+                               if (!isset($embeddedObjects[$row['embeddedObjectTypeID']])) $embeddedObjects[$row['embeddedObjectTypeID']] = [];
+                               $embeddedObjects[$row['embeddedObjectTypeID']][] = $row['embeddedObjectID'];
                        }
                        
-                       // group objects by object type
-                       if (!isset($embeddedObjects[$row['embeddedObjectTypeID']])) $embeddedObjects[$row['embeddedObjectTypeID']] = [];
-                       $embeddedObjects[$row['embeddedObjectTypeID']][] = $row['embeddedObjectID'];
-                       
                        // store message to embedded object assignment
                        if (!isset($this->messageEmbeddedObjects[$row['messageObjectTypeID']][$row['messageID']][$row['embeddedObjectTypeID']])) {
                                $this->messageEmbeddedObjects[$row['messageObjectTypeID']][$row['messageID']][$row['embeddedObjectTypeID']] = [];