Support WysiwygFormContainer as children of ITabMenuFormContainer
authorTitus Kirch <titus.kirch@tkirch.dev>
Wed, 30 Dec 2020 01:11:55 +0000 (02:11 +0100)
committerMatthias Schmidt <gravatronics@live.com>
Fri, 15 Jan 2021 10:28:09 +0000 (11:28 +0100)
wcfsetup/install/files/lib/system/form/builder/container/FormContainer.class.php

index 008a3cda3b448a7c9fe825e9c01587aac2fa7f88..ba164f9137922112374405ce1d3687ae16cc8822 100644 (file)
@@ -1,6 +1,7 @@
 <?php
 namespace wcf\system\form\builder\container;
 use wcf\data\IStorableObject;
+use wcf\system\form\builder\container\wysiwyg\WysiwygFormContainer;
 use wcf\system\form\builder\IFormChildNode;
 use wcf\system\form\builder\IFormDocument;
 use wcf\system\form\builder\TFormChildNode;
@@ -94,7 +95,7 @@ class FormContainer implements IFormContainer {
                
                if ($child instanceof ITabMenuFormContainer) {
                        $parent = $this;
-                       while (!($parent instanceof IFormDocument) && $parent = $parent->getParent()) {
+                       while (!($parent instanceof IFormDocument || $parent instanceof WysiwygFormContainer) && $parent = $parent->getParent()) {
                                if ($parent instanceof ITabMenuFormContainer) {
                                        throw new \InvalidArgumentException("A tab menu container may only have another tab menu container as a parent, not as an earlier ancestor.");
                                }