Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/View/Antlers/Language/Runtime/NodeProcessor.php
Original file line numberDiff line numberDiff line change
Expand Up@@ -2589,7 +2589,7 @@ private function evaluatePhpBuffer(string $___phpBuffer, bool $___processAssignm
foreach ($___antlersVarAfter as $___varKey => $___varValue) {
if (
str_starts_with($___varKey, '___') ||
(isset($___antlersVarBefore[$___varKey]) && $___antlersVarBefore[$___varKey] === $___varValue)
(array_key_exists($___varKey, $___antlersVarBefore) && $___antlersVarBefore[$___varKey] === $___varValue)
) {
continue;
}
Expand Down
13 changes: 13 additions & 0 deletions tests/Antlers/Runtime/PartialsTest.php
Original file line numberDiff line numberDiff line change
Expand Up@@ -82,4 +82,17 @@ public function test_double_colons_may_be_used_in_tag_method_part()

$this->renderString($template, [], true);
}

public function test_assignments_in_earlier_partials_do_not_blank_a_later_partials_slot()
{
$template = <<<'EOT'
{{? $foo = 'bar' ?}}{{ partial:filter /}}{{ partial:card }}KEEPME{{ /partial:card }}
EOT;

$this->withFakeViews();
$this->viewShouldReturnRaw('filter', "{{? \$values = 'v' ?}}FILTER");
$this->viewShouldReturnRaw('card', "{{ trans key='hi' }}<slot>{{ slot }}</slot>");

$this->assertSame('FILTERhi<slot>KEEPME</slot>', $this->renderString($template, [], true));
}
}
Loading