Skip to content

Commit

Permalink
[BUGFIX] Solve issue with the partials handling
Browse files Browse the repository at this point in the history
  • Loading branch information
DigitalZombies committed Apr 11, 2024
1 parent ae1d27b commit 9cacec0
Showing 1 changed file with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,21 +66,19 @@ public static function renderStatic(array $arguments, \Closure $renderChildrenCl
}
$subView = GeneralUtility::makeInstance(StandaloneView::class);
$r = clone $view->getRenderingContext();

$subView->setRequest($renderingContext->getRequest());
$subView->getRenderingContext()->setTemplatePaths($r->getTemplatePaths());
$templateName = $data->getFullType();
if (count($templateNameParts = explode('.', $templateName)) === 2) {
$templateName = ucfirst($templateNameParts[0]) . '/' . GeneralUtility::underscoredToUpperCamelCase($templateNameParts[1]);
if (count($templateNameParts = explode('.', $data->getFullType())) === 2) {
$subView->getRenderingContext()->setControllerName(ucfirst($templateNameParts[0]));
$subView->getRenderingContext()->setControllerAction(GeneralUtility::underscoredToLowerCamelCase($templateNameParts[1]));
}
$subView->setTemplate($templateName);

$subView->setTemplate($templateName);
// @todo: consider using the same variables
$subView->assign('data', $data->toArray(true));
$subView->assign('context', $context);
try {
$content = $subView->render();
} catch (InvalidTemplateResourceException) {
} catch (InvalidTemplateResourceException $ex) {
// Render via TypoScript as fallback
/** @var CObjectViewHelper $cObjectViewHelper */
$cObjectViewHelper = $view->getViewHelperResolver()->createViewHelperInstance('f', 'cObject');
Expand Down

0 comments on commit 9cacec0

Please sign in to comment.