Skip to content
This repository has been archived by the owner on Dec 19, 2019. It is now read-only.

Commit

Permalink
ENGCOM-6164: Magento 2.3.2 - PWA - graphQl fetching Issue for phtml f…
Browse files Browse the repository at this point in the history
…ile called in static block #960 #971

 - Merge Pull Request #971 from XxXgeoXxX/graphql-ce:2.3-devlop#960
 - Merged commits:
   1. b94085e
   2. 0ee4cdd
   3. 30eebde
   4. 6295376
   5. 106f398
  • Loading branch information
magento-engcom-team committed Oct 24, 2019
2 parents cc599e5 + 106f398 commit 59c4565
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 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
28 changes: 27 additions & 1 deletion app/code/Magento/Widget/Model/Template/FilterEmulate.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,44 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);

namespace Magento\Widget\Model\Template;

/**
* Class FilterEmulate
*
* @package Magento\Widget\Model\Template
*/
class FilterEmulate extends Filter
{
/**
* Generate widget with emulation frontend area
*
* @param string[] $construction
* @return string
*
* @return mixed|string
* @throws \Exception
*/
public function widgetDirective($construction)
{
return $this->_appState->emulateAreaCode('frontend', [$this, 'generateWidget'], [$construction]);
}

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

0 comments on commit 59c4565

Please sign in to comment.