From 1274bd59619d0059fd1f031d72082e4838527c69 Mon Sep 17 00:00:00 2001 From: Damien VERNER Date: Tue, 1 Oct 2024 14:46:06 +0200 Subject: [PATCH] Fix regression with template custom parameters --- Services/Twig/FetchExtension.php | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/Services/Twig/FetchExtension.php b/Services/Twig/FetchExtension.php index efb88b9..3b6b05a 100644 --- a/Services/Twig/FetchExtension.php +++ b/Services/Twig/FetchExtension.php @@ -91,24 +91,22 @@ public function renderChildren( $firstKey = key($children); // Define specific parameters - $currParameters = $parameters; - $currParameters['params'] = $parameters; - $currParameters['params']['col'] = count($children); + $parameters['col'] = count($children); foreach ($children as $index => $child) { - $currParameters['params']['isFirst'] = $index === $firstKey; - $currParameters['params']['isLast'] = $index === $lastKey; - $currParameters['params']['index'] = $index; + $parameters['isFirst'] = $index === $firstKey; + $parameters['isLast'] = $index === $lastKey; + $parameters['index'] = $index; try { $content = $child->getContent(); - $currParameters['location'] = $child; - $currParameters['viewType'] = $viewType; - $currParameters['layout'] = false; + $parameters['location'] = $child; + $parameters['viewType'] = $viewType; + $parameters['layout'] = false; $contentRender = $this->viewManager->renderContent( $content, $viewType, - $currParameters + $parameters ); $render .= $contentRender; } catch (Exception $exception) {