From edea6060af9400396cc00ce80abe4e12fdc1430e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petar=20=C5=A0panja?= Date: Wed, 12 Jun 2024 07:59:11 +0200 Subject: [PATCH 1/2] NGSTACK-904: use Core Content View Builder for rendering Ibexa views --- bundle/Resources/config/services/view.yaml | 1 + bundle/View/ContentRenderer.php | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) 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( From 0b72a1d58b64f7edee667df7619feaef48b02341 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petar=20=C5=A0panja?= Date: Wed, 12 Jun 2024 13:54:19 +0200 Subject: [PATCH 2/2] NGSTACK-904: remove asserting ContentType ID because SQLite Gateway now uses hrtime for calculating next ID --- tests/lib/Integration/BaseTest.php | 1 - 1 file changed, 1 deletion(-) 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);