From 01e89d75601f87d463b8cf5a9041f44bfd3b4335 Mon Sep 17 00:00:00 2001 From: roadiz-ci Date: Fri, 15 Mar 2024 17:25:09 +0000 Subject: [PATCH] fix: Removed NodeTypeInterface from Node constructor, Removed ThemeRoutesLoader.php --- config/packages/roadiz_core.yaml | 1 - config/routing.yaml | 4 ---- src/Entity/Node.php | 4 +--- src/Node/NodeFactory.php | 3 ++- src/Node/NodeTranstyper.php | 1 + src/Node/UniqueNodeGenerator.php | 3 ++- 6 files changed, 6 insertions(+), 10 deletions(-) diff --git a/config/packages/roadiz_core.yaml b/config/packages/roadiz_core.yaml index 85272097..1f5bf32d 100644 --- a/config/packages/roadiz_core.yaml +++ b/config/packages/roadiz_core.yaml @@ -11,7 +11,6 @@ roadiz_core: # Be careful if you are using a reverse-proxy cache, YOU MUST vary on Accept-Language header and normalize it. # @see https://varnish-cache.org/docs/6.3/users-guide/increasing-your-hitrate.html#http-vary useAcceptLanguageHeader: '%env(bool:APP_USE_ACCEPT_LANGUAGE_HEADER)%' - themes: [] medias: unsplash_client_id: '%env(string:APP_UNSPLASH_CLIENT_ID)%' soundcloud_client_id: '%env(string:APP_SOUNDCLOUD_CLIENT_ID)%' diff --git a/config/routing.yaml b/config/routing.yaml index 2de42814..e3a597bc 100644 --- a/config/routing.yaml +++ b/config/routing.yaml @@ -33,10 +33,6 @@ healthCheckAction: stateless: true controller: RZ\Roadiz\CoreBundle\Controller\HealthCheckController -roadiz_core_themes: - resource: . - type: themes - api_login_check: methods: [POST] stateless: true diff --git a/src/Entity/Node.php b/src/Entity/Node.php index 2371d557..547ec995 100644 --- a/src/Entity/Node.php +++ b/src/Entity/Node.php @@ -318,7 +318,7 @@ class Node extends AbstractDateTimedPositioned implements LeafInterface, Attribu /** * Create a new empty Node according to given node-type. */ - public function __construct(NodeTypeInterface $nodeType = null) + public function __construct() { $this->nodesTags = new ArrayCollection(); $this->children = new ArrayCollection(); @@ -328,8 +328,6 @@ public function __construct(NodeTypeInterface $nodeType = null) $this->aNodes = new ArrayCollection(); $this->bNodes = new ArrayCollection(); $this->attributeValues = new ArrayCollection(); - - $this->setNodeType($nodeType); $this->initAbstractDateTimed(); } diff --git a/src/Node/NodeFactory.php b/src/Node/NodeFactory.php index 4776bbb0..33833648 100644 --- a/src/Node/NodeFactory.php +++ b/src/Node/NodeFactory.php @@ -43,7 +43,8 @@ public function create( } if ($node === null) { - $node = new Node($type); + $node = new Node(); + $node->setNodeType($type); } if ($type instanceof NodeType) { diff --git a/src/Node/NodeTranstyper.php b/src/Node/NodeTranstyper.php index 29060aa1..8ea9d2a4 100644 --- a/src/Node/NodeTranstyper.php +++ b/src/Node/NodeTranstyper.php @@ -257,6 +257,7 @@ protected function mockTranstype(NodeTypeInterface $nodeType): void * transtype, not to get an orphan node. */ $node = new Node(); + $node->setNodeType($nodeType); $node->setNodeName('testing_before_transtype' . $uniqueId); $this->getManager()->persist($node); diff --git a/src/Node/UniqueNodeGenerator.php b/src/Node/UniqueNodeGenerator.php index d8b2d356..718cea75 100644 --- a/src/Node/UniqueNodeGenerator.php +++ b/src/Node/UniqueNodeGenerator.php @@ -49,7 +49,8 @@ public function generate( bool $pushToTop = false ): NodesSources { $name = $nodeType->getDisplayName() . " " . uniqid(); - $node = new Node($nodeType); + $node = new Node(); + $node->setNodeType($nodeType); $node->setTtl($nodeType->getDefaultTtl()); if (null !== $tag) {