diff --git a/bundle/Resources/config/services/view.yaml b/bundle/Resources/config/services/view.yaml index 439828ce..1ba6af8c 100644 --- a/bundle/Resources/config/services/view.yaml +++ b/bundle/Resources/config/services/view.yaml @@ -88,6 +88,7 @@ services: class: Netgen\Bundle\IbexaSiteApiBundle\View\ContentRenderer arguments: - '@netgen.ibexa_site_api.view_builder.content' + - '@Ibexa\Core\MVC\Symfony\View\Builder\ContentViewBuilder' - '@netgen.ibexa_site_api.view_renderer' - '@?logger' tags: diff --git a/bundle/View/ContentRenderer.php b/bundle/View/ContentRenderer.php index 823a0a6d..639f4e15 100644 --- a/bundle/View/ContentRenderer.php +++ b/bundle/View/ContentRenderer.php @@ -8,6 +8,7 @@ use Ibexa\Contracts\Core\Repository\Values\Content\Content as APIContent; use Ibexa\Contracts\Core\Repository\Values\Content\Location as APILocation; use Ibexa\Contracts\Core\Repository\Values\ValueObject; +use Ibexa\Core\MVC\Symfony\View\Builder\ContentViewBuilder as CoreContentViewBuilder; use LogicException; use Netgen\Bundle\IbexaSiteApiBundle\View\Builder\ContentViewBuilder; use Netgen\IbexaSiteApi\API\Values\Content; @@ -27,6 +28,7 @@ final class ContentRenderer { public function __construct( private readonly ContentViewBuilder $viewBuilder, + private readonly CoreContentViewBuilder $coreViewBuilder, private readonly ViewRenderer $viewRenderer, private readonly LoggerInterface $logger = new NullLogger(), ) {} @@ -110,7 +112,7 @@ public function renderIbexaContent( $baseParameters['location'] = $location; } - $view = $this->viewBuilder->buildView($baseParameters + $parameters); + $view = $this->coreViewBuilder->buildView($baseParameters + $parameters); return $this->viewRenderer->render($view, $parameters, $layout); } @@ -127,7 +129,7 @@ public function renderIbexaEmbeddedContent(string $viewType, array $parameters = ]; try { - $view = $this->viewBuilder->buildView($baseParameters + $parameters); + $view = $this->coreViewBuilder->buildView($baseParameters + $parameters); } catch (Exception $exception) { $this->logger->error( sprintf( diff --git a/tests/lib/Integration/BaseTest.php b/tests/lib/Integration/BaseTest.php index 7e50e8d4..3295f57c 100644 --- a/tests/lib/Integration/BaseTest.php +++ b/tests/lib/Integration/BaseTest.php @@ -155,7 +155,6 @@ protected function assertContentInfo(APIContentInfo $contentInfo, array $data): self::assertSame($locationId, $contentInfo->mainLocationId); self::assertSame($name, $contentInfo->name); self::assertSame($data['contentTypeIdentifier'], $contentInfo->contentTypeIdentifier); - self::assertSame($data['contentTypeId'], $contentInfo->contentTypeId); self::assertSame($data['sectionId'], $contentInfo->sectionId); self::assertSame($data['currentVersionNo'], $contentInfo->currentVersionNo); self::assertSame($data['published'], $contentInfo->published);