Skip to content

Commit

Permalink
magento/graphql-ce#960: PWA - graphQl fetching Issue for phtml file c…
Browse files Browse the repository at this point in the history
…alled in static block
  • Loading branch information
lenaorobei committed Oct 24, 2019
1 parent 6295376 commit 106f398
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function getData(string $blockIdentifier): array
);
}

$renderedContent = $this->widgetFilter->filter($block->getContent());
$renderedContent = $this->widgetFilter->filterDirective($block->getContent());

$blockData = [
BlockInterface::BLOCK_ID => $block->getId(),
Expand Down
10 changes: 7 additions & 3 deletions app/code/Magento/Widget/Model/Template/FilterEmulate.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<?php declare(strict_types=1);
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);

namespace Magento\Widget\Model\Template;

/**
Expand All @@ -26,16 +28,18 @@ public function widgetDirective($construction)
}

/**
* Filter the string as template with frontend area emulation
*
* @param string $value
*
* @return string
* @throws \Exception
*/
public function filter($value) : string
public function filterDirective($value) : string
{
return $this->_appState->emulateAreaCode(
\Magento\Framework\App\Area::AREA_FRONTEND,
[$this, 'parent::filter'],
[$this, 'filter'],
[$value]
);
}
Expand Down

0 comments on commit 106f398

Please sign in to comment.