Skip to content

Commit

Permalink
fix: Removed NodeTypeInterface from Node constructor, Removed ThemeRo…
Browse files Browse the repository at this point in the history
…utesLoader.php
  • Loading branch information
roadiz-ci committed Mar 15, 2024
1 parent 58a7afe commit 01e89d7
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 10 deletions.
1 change: 0 additions & 1 deletion config/packages/roadiz_core.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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)%'
Expand Down
4 changes: 0 additions & 4 deletions config/routing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 1 addition & 3 deletions src/Entity/Node.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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();
}

Expand Down
3 changes: 2 additions & 1 deletion src/Node/NodeFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ public function create(
}

if ($node === null) {
$node = new Node($type);
$node = new Node();
$node->setNodeType($type);
}

if ($type instanceof NodeType) {
Expand Down
1 change: 1 addition & 0 deletions src/Node/NodeTranstyper.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
3 changes: 2 additions & 1 deletion src/Node/UniqueNodeGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 01e89d7

Please sign in to comment.