Skip to content

Commit

Permalink
Merge branch hotfix/v2.2.10
Browse files Browse the repository at this point in the history
  • Loading branch information
roadiz-ci committed Mar 7, 2024
1 parent 89db261 commit 7851a69
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 19 deletions.
2 changes: 1 addition & 1 deletion config/services.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
parameters:
roadiz_core.cms_version: '2.2.9'
roadiz_core.cms_version: '2.2.10'
roadiz_core.cms_version_prefix: 'main'
env(APP_NAMESPACE): "roadiz"
env(APP_VERSION): "0.1.0"
Expand Down
22 changes: 4 additions & 18 deletions src/Importer/NodeTypesImporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,16 @@

use JMS\Serializer\DeserializationContext;
use JMS\Serializer\SerializerInterface;
use RZ\Roadiz\Core\Handlers\HandlerFactoryInterface;
use RZ\Roadiz\CoreBundle\Entity\NodeType;
use RZ\Roadiz\CoreBundle\EntityHandler\NodeTypeHandler;
use RZ\Roadiz\CoreBundle\Serializer\ObjectConstructor\TypedObjectConstructorInterface;

class NodeTypesImporter implements EntityImporterInterface
{
protected SerializerInterface $serializer;
protected HandlerFactoryInterface $handlerFactory;


public function __construct(SerializerInterface $serializer, HandlerFactoryInterface $handlerFactory)
{
$this->serializer = $serializer;
$this->handlerFactory = $handlerFactory;
public function __construct(
protected SerializerInterface $serializer
) {
}

/**
* @inheritDoc
*/
public function supports(string $entityClass): bool
{
return $entityClass === NodeType::class;
Expand All @@ -36,7 +26,7 @@ public function supports(string $entityClass): bool
*/
public function import(string $serializedData): bool
{
$nodeType = $this->serializer->deserialize(
$this->serializer->deserialize(
$serializedData,
NodeType::class,
'json',
Expand All @@ -45,10 +35,6 @@ public function import(string $serializedData): bool
->setAttribute(TypedObjectConstructorInterface::FLUSH_NEW_OBJECTS, true)
);

/** @var NodeTypeHandler $nodeTypeHandler */
$nodeTypeHandler = $this->handlerFactory->getHandler($nodeType);
$nodeTypeHandler->updateSchema();

return true;
}
}

0 comments on commit 7851a69

Please sign in to comment.