Skip to content

Commit

Permalink
- Fixed _currentBlock variable in template engine
Browse files Browse the repository at this point in the history
  • Loading branch information
thampe committed Oct 18, 2020
1 parent 2c6c7b0 commit c8a926e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
11 changes: 3 additions & 8 deletions Framework/View/TemplateEngine/Twig.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,6 @@ class Twig extends Php
*/
protected $eventManager;

/**
* @var BlockInterface
*/
protected $currentBlock;

/**
* @param ObjectManagerInterface $helperFactory
* @param DirectoryList $directoryList
Expand Down Expand Up @@ -151,11 +146,11 @@ public function catchGet(...$args)
*/
public function render(BlockInterface $block, $fileName, array $dictionary = [])
{
$tmpBlock = $this->currentBlock;
$this->currentBlock = $block;
$tmpBlock = $this->_currentBlock;
$this->_currentBlock = $block;
$this->twig->addGlobal('block', $block);
$result = $this->getTemplate($fileName)->render($dictionary);
$this->currentBlock = $tmpBlock;
$this->_currentBlock = $tmpBlock;
return $result;
}

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"twig/twig": "^3.0"
},
"type": "magento2-module",
"version": "2.0.0",
"version": "2.0.1",
"license": [
"OSL-3.0"
],
Expand Down

0 comments on commit c8a926e

Please sign in to comment.