From 942df9f82a654d674edc62e0d2edd86357d3843f Mon Sep 17 00:00:00 2001 From: Dawid Parafinski Date: Tue, 15 Oct 2024 13:04:55 +0200 Subject: [PATCH] IBX-8534: Renamed pagelayout parameter --- src/lib/Behat/Context/PagelayoutContext.php | 6 ++---- src/lib/EventListener/ViewTemplatesListener.php | 7 +++---- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/lib/Behat/Context/PagelayoutContext.php b/src/lib/Behat/Context/PagelayoutContext.php index a47f1f5..755a2ae 100644 --- a/src/lib/Behat/Context/PagelayoutContext.php +++ b/src/lib/Behat/Context/PagelayoutContext.php @@ -34,7 +34,7 @@ public function __construct(ConfigResolverInterface $configResolver) */ public function aPagelayoutIsConfigured() { - Assertion::assertTrue($this->configResolver->hasParameter('pagelayout')); + Assertion::assertTrue($this->configResolver->hasParameter('page_layout')); } /** @@ -50,8 +50,6 @@ public function itIsRenderedUsingTheConfiguredPagelayout() public function getPageLayout(): string { - return $this->configResolver->hasParameter('page_layout') - ? $this->configResolver->getParameter('page_layout', null, 'site') - : $this->configResolver->getParameter('pagelayout', null, 'site'); + return $this->configResolver->getParameter('page_layout', null, 'site'); } } diff --git a/src/lib/EventListener/ViewTemplatesListener.php b/src/lib/EventListener/ViewTemplatesListener.php index 9e1df92..b8995bc 100644 --- a/src/lib/EventListener/ViewTemplatesListener.php +++ b/src/lib/EventListener/ViewTemplatesListener.php @@ -37,18 +37,17 @@ public static function getSubscribedEvents() /** * If the event's view has a defined template, sets the view's template identifier, - * and the 'pagelayout' parameter. + * and the 'page_layout' parameter. */ public function setViewTemplates(PreContentViewEvent $event): void { $view = $event->getContentView(); - $pagelayout = $this->configResolver->getParameter('pagelayout'); + $pageLayout = $this->configResolver->getParameter('page_layout'); foreach ($this->getTemplatesMap() as $viewClass => $template) { if ($view instanceof $viewClass) { $view->setTemplateIdentifier($template); - $view->addParameters(['pagelayout' => $pagelayout]); - $view->addParameters(['page_layout' => $pagelayout]); + $view->addParameters(['page_layout' => $pageLayout]); } } }