From 78b0e1bf7ed7d51252c2a14f700716eef5b72c24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20B=C3=B6hmer?= Date: Tue, 13 Jun 2023 21:00:25 +0200 Subject: [PATCH] Fixed errors when setting setParent on a proxied AbstractStructuralDBElement --- src/Entity/Base/AbstractStructuralDBElement.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/Entity/Base/AbstractStructuralDBElement.php b/src/Entity/Base/AbstractStructuralDBElement.php index f1e3794c..6f8378ca 100644 --- a/src/Entity/Base/AbstractStructuralDBElement.php +++ b/src/Entity/Base/AbstractStructuralDBElement.php @@ -26,6 +26,7 @@ use App\Entity\Attachments\Attachment; use App\Entity\Parameters\AbstractParameter; use App\Repository\StructuralDBElementRepository; use App\EntityListeners\TreeCacheInvalidationListener; +use Doctrine\Common\Proxy\Proxy; use Doctrine\DBAL\Types\Types; use App\Entity\Attachments\AttachmentContainingDBElement; use App\Entity\Parameters\ParametersTrait; @@ -348,11 +349,6 @@ abstract class AbstractStructuralDBElement extends AttachmentContainingDBElement throw new \InvalidArgumentException('You can not use one of the element childs as parent!'); } */ - //Ensure that the parent is of the same type as this element - if (!$new_parent instanceof static) { - throw new \InvalidArgumentException('The parent must be of the same type as this element!'); - } - $this->parent = $new_parent; //Add this element as child to the new parent