Skip to content

Commit 0eb835f

Browse files
committed
Fix condition if child nodes should be handled and add tests
1 parent 624ef23 commit 0eb835f

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

Classes/Fluid/ViewHelper/ComponentRenderer.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,7 @@ protected function extractViewHelpers(NodeInterface $node, string $viewHelperCla
581581
$viewHelperNodes[] = $node;
582582
} else {
583583
foreach ($node->getChildNodes() as $childNode) {
584-
if ($recursive === false && $childNode instanceof ViewHelperNode && $childNode->getViewHelperClassName() === ComponentViewHelper::class) {
584+
if ($recursive === false && $childNode instanceof ViewHelperNode && ($childNode->getViewHelperClassName() === ComponentViewHelper::class || $childNode->getUninitializedViewHelper() instanceof ComponentRenderer)) {
585585
continue;
586586
}
587587
$viewHelperNodes = array_merge(

Tests/Functional/SlotParameterTest.php

+8
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,14 @@ public function renderDataProvider(): \Generator
6464
'<test:contentSlot><fc:content><b>some html</b></fc:content></test:contentSlot><test:contentSlot><b>other html</b></test:contentSlot>',
6565
"<b>some html</b>\n<b>other html</b>\n"
6666
];
67+
yield 'two nested component calls with named slots' => [
68+
'<test:contentSlot><b>some html</b><test:contentSlot><fc:content><b>other html</b></fc:content></test:contentSlot></test:contentSlot>',
69+
"<b>some html</b><b>other html</b>\n"
70+
];
71+
yield 'two different nested component calls with named slots' => [
72+
'<test:contentSlot><fc:content><b>some html</b><test:twoSlotsAndContent><fc:content slot="slot1"><b>slot 1 html</b></fc:content><fc:content slot="slot2"><b>slot 2 html</b></fc:content>slot content</test:twoSlotsAndContent></fc:content></test:contentSlot>',
73+
"<b>some html</b><b>slot 1 html</b>|<b>slot 2 html</b>|slot content\n"
74+
];
6775

6876
// Check if slot object behaves correct for if statements
6977
yield 'unspecified slot parameter' => [

0 commit comments

Comments
 (0)