Skip to content

Commit 106f398

Browse files
committed
magento/graphql-ce#960: PWA - graphQl fetching Issue for phtml file called in static block
1 parent 6295376 commit 106f398

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

app/code/Magento/CmsGraphQl/Model/Resolver/DataProvider/Block.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public function getData(string $blockIdentifier): array
5656
);
5757
}
5858

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

6161
$blockData = [
6262
BlockInterface::BLOCK_ID => $block->getId(),

app/code/Magento/Widget/Model/Template/FilterEmulate.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
<?php declare(strict_types=1);
1+
<?php
22
/**
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
declare(strict_types=1);
7+
68
namespace Magento\Widget\Model\Template;
79

810
/**
@@ -26,16 +28,18 @@ public function widgetDirective($construction)
2628
}
2729

2830
/**
31+
* Filter the string as template with frontend area emulation
32+
*
2933
* @param string $value
3034
*
3135
* @return string
3236
* @throws \Exception
3337
*/
34-
public function filter($value) : string
38+
public function filterDirective($value) : string
3539
{
3640
return $this->_appState->emulateAreaCode(
3741
\Magento\Framework\App\Area::AREA_FRONTEND,
38-
[$this, 'parent::filter'],
42+
[$this, 'filter'],
3943
[$value]
4044
);
4145
}

0 commit comments

Comments
 (0)