Skip to content

Commit c8a926e

Browse files
committed
- Fixed _currentBlock variable in template engine
1 parent 2c6c7b0 commit c8a926e

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

Framework/View/TemplateEngine/Twig.php

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,6 @@ class Twig extends Php
4747
*/
4848
protected $eventManager;
4949

50-
/**
51-
* @var BlockInterface
52-
*/
53-
protected $currentBlock;
54-
5550
/**
5651
* @param ObjectManagerInterface $helperFactory
5752
* @param DirectoryList $directoryList
@@ -151,11 +146,11 @@ public function catchGet(...$args)
151146
*/
152147
public function render(BlockInterface $block, $fileName, array $dictionary = [])
153148
{
154-
$tmpBlock = $this->currentBlock;
155-
$this->currentBlock = $block;
149+
$tmpBlock = $this->_currentBlock;
150+
$this->_currentBlock = $block;
156151
$this->twig->addGlobal('block', $block);
157152
$result = $this->getTemplate($fileName)->render($dictionary);
158-
$this->currentBlock = $tmpBlock;
153+
$this->_currentBlock = $tmpBlock;
159154
return $result;
160155
}
161156

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"twig/twig": "^3.0"
1010
},
1111
"type": "magento2-module",
12-
"version": "2.0.0",
12+
"version": "2.0.1",
1313
"license": [
1414
"OSL-3.0"
1515
],

0 commit comments

Comments
 (0)