Fix `TFormParentNode::insertBefore()`
authorMatthias Schmidt <gravatronics@live.com>
Mon, 1 Jan 2018 08:22:56 +0000 (09:22 +0100)
committerMatthias Schmidt <gravatronics@live.com>
Mon, 1 Jan 2018 08:22:56 +0000 (09:22 +0100)
See #2509

wcfsetup/install/files/lib/system/form/builder/TFormParentNode.class.php

index 1a560fc4a4fe8e68b5c8b261f93994cb441bf692..940a78dc0b20007b93d52958bb33f95173fb541d 100644 (file)
@@ -207,7 +207,9 @@ trait TFormParentNode {
                $didInsertNode = false;
                foreach ($this->children() as $index => $existingChild) {
                        if ($existingChild->getId() === $referenceNodeId) {
-                               array_splice($this->__children, $index, 0, $child);
+                               array_splice($this->__children, $index, 0, [$child]);
+                               
+                               $child->parent($this);
                                
                                $didInsertNode = true;
                                break;