You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using {$this->hasBlock()} the LayerTop array has many entries of Latte\Runtime\Block instances (key being the block's name), but it is empty when called using {hasBlock()}. In fact, the whole $this->blocks array only contains another empty arrays in this case.
I tried to make a failing example on fiddle.nette.org/latte, but I'm not able to simulate the relation between @layout.latte and a presenter/action template.
Expected Behavior
Both approaches have the same result.
Possible Solution
N/A
The text was updated successfully, but these errors were encountered:
Gappa
changed the title
{$this->hasBlock('test)} yields different result than {hasBlock('test')}
{$this->hasBlock('test')} yields different result than {hasBlock('test')}
Feb 7, 2024
Note for anyone updating - if you see this error, don't panic 🙂
The solution is easy - clear latte cache.
TypeError
Latte\Essential\CoreExtension::Latte\Essential\{closure}(): Argument #1 ($template) must be of type Latte\Runtime\Template, string given, called in /{path_to_project}/temp/cache/latte/[email protected] on line 321
Version: 3.0.13
earlier versions probably too - related issue: #345
Bug Description
{$this->hasBlock('test')}
yields different result than{hasBlock('test')}
.Relevant code:
latte/src/Latte/Essential/CoreExtension.php
Line 194 in 462444d
latte/src/Latte/Runtime/Template.php
Lines 379 to 382 in 462444d
When using
{$this->hasBlock()}
theLayerTop
array has many entries ofLatte\Runtime\Block
instances (key being the block's name), but it is empty when called using{hasBlock()}
. In fact, the whole$this->blocks
array only contains another empty arrays in this case.Steps To Reproduce
default.latte (template of a presenter's action)
@layout.latte (main layout)
Also, this in
@layout.latte
doesn't work:Result:
Which is strange, because on fiddle it works:
I tried to make a failing example on fiddle.nette.org/latte, but I'm not able to simulate the relation between
@layout.latte
and a presenter/action template.Expected Behavior
Both approaches have the same result.
Possible Solution
N/A
The text was updated successfully, but these errors were encountered: