Skip to content

Commit

Permalink
Merge branch 'hotfix/v2.3.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
ambroisemaupate committed May 22, 2024
2 parents 353d4f4 + e72289f commit 1876eea
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 10 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

All notable changes to Roadiz will be documented in this file.

## [2.3.1](https://github.com/roadiz/core-bundle-dev-app/compare/v2.3.0...v2.3.1) - 2024-05-22

### Bug Fixes

- **(Node)** Always set node TTL against its node-type - ([a772d06](https://github.com/roadiz/core-bundle-dev-app/commit/a772d065602cf7411ae7a090707e3809f7c6e9f4))

## [2.3.0](https://github.com/roadiz/core-bundle-dev-app/compare/v2.2.15...v2.3.0) - 2024-05-15

### ⚠ BREAKING CHANGES
Expand Down
2 changes: 1 addition & 1 deletion config/api_resources/web_response.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
resources:
RZ\Roadiz\CoreBundle\Api\Model\WebResponse:
graphQlOperations: []
graphQlOperations: { }
operations:
article_get_by_path:
method: GET
Expand Down
2 changes: 1 addition & 1 deletion lib/RoadizCoreBundle/config/services.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
parameters:
roadiz_core.cms_version: '2.3.0'
roadiz_core.cms_version: '2.3.1'
roadiz_core.cms_version_prefix: 'main'
env(APP_NAMESPACE): "roadiz"
env(APP_VERSION): "0.1.0"
Expand Down
5 changes: 3 additions & 2 deletions lib/RoadizCoreBundle/src/Node/NodeFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,10 @@ public function create(
$node->setNodeType($type);
}

if ($type instanceof NodeType) {
$node->setTtl($type->getDefaultTtl());
if ($node->getNodeType() instanceof NodeType) {
$node->setTtl($node->getNodeType()->getDefaultTtl());
}

if (null !== $parent) {
$node->setParent($parent);
}
Expand Down
1 change: 1 addition & 0 deletions lib/Rozier/src/Controllers/Nodes/NodesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,7 @@ public function addAction(Request $request, int $nodeTypeId, ?int $translationId

$node = new Node();
$node->setNodeType($type);
$node->setTtl($type->getDefaultTtl());

$chroot = $this->nodeChrootResolver->getChroot($this->getUser());
if (null !== $chroot) {
Expand Down
4 changes: 1 addition & 3 deletions lib/Rozier/src/Traits/NodesTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,9 @@ abstract protected function getNodeFactory(): NodeFactory;
* @param NodeTypeInterface|null $type
*
* @return Node
* @throws \Doctrine\ORM\ORMException
* @throws \Doctrine\ORM\OptimisticLockException
*/
protected function createNode(
$title,
string $title,
TranslationInterface $translation,
Node $node = null,
NodeTypeInterface $type = null
Expand Down
2 changes: 1 addition & 1 deletion src/Resources/node-types/Article.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,6 @@
"visible": true
}
],
"default_ttl": 0,
"default_ttl": 15,
"searchable": true
}
4 changes: 2 additions & 2 deletions src/Resources/node-types/Page.json
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,6 @@
"visible": true
}
],
"default_ttl": 0,
"default_ttl": 15,
"searchable": true
}
}

0 comments on commit 1876eea

Please sign in to comment.