mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-03-03 05:55:16 +01:00
Fixed errors when setting setParent on a proxied AbstractStructuralDBElement
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user