Skip to content

Commit 8581a42

Browse files
committed
MC-16152: Login Only B2B breaks Page Builder preview
- Fix static failures
1 parent 50be832 commit 8581a42

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

app/code/Magento/PageBuilder/Controller/Adminhtml/Stage/Preview.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
*/
2222
class Preview extends \Magento\Backend\App\Action implements HttpPostActionInterface
2323
{
24+
const ADMIN_RESOURCE = 'Magento_Backend::content';
25+
2426
/**
2527
* @var \Magento\PageBuilder\Model\Stage\RendererPool
2628
*/
@@ -66,7 +68,10 @@ class Preview extends \Magento\Backend\App\Action implements HttpPostActionInter
6668
* @param \Magento\PageBuilder\Model\Stage\RendererPool $rendererPool
6769
* @param \Magento\Store\Model\App\Emulation $emulation
6870
* @param \Magento\Framework\App\State $appState
69-
* @param \Magento\Theme\Model\View\Design $design
71+
* @param \Magento\Framework\View\DesignInterface $design
72+
* @param \Magento\Framework\View\Design\Theme\ThemeProviderInterface $themeProvider
73+
* @param \Magento\Store\Model\StoreManagerInterface $storeManager
74+
* @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
7075
* @param \Magento\PageBuilder\Model\Stage\PreviewRegistry $previewRegistry
7176
*/
7277
public function __construct(
@@ -95,7 +100,8 @@ public function __construct(
95100
/**
96101
* Generates an HTML preview for the stage
97102
*
98-
* @return \Magento\Framework\Controller\ResultInterface
103+
* @return \Magento\Framework\App\ResponseInterface|\Magento\Framework\Controller\ResultInterface|mixed
104+
* @throws \Exception
99105
*/
100106
public function execute()
101107
{

app/code/Magento/PageBuilder/Model/Stage/PreviewRegistry.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class PreviewRegistry
2222
*
2323
* @return string
2424
*/
25-
public function getPreviewArea()
25+
public function getPreviewArea() : string
2626
{
2727
return \Magento\Framework\App\Area::AREA_FRONTEND;
2828
}
@@ -42,7 +42,7 @@ public function setIsPreview(bool $isPreview)
4242
*
4343
* @return bool
4444
*/
45-
public function getIsPreview()
45+
public function isPreview() : bool
4646
{
4747
return $this->isPreview;
4848
}

app/code/Magento/PageBuilder/Plugin/DesignLoader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public function beforeCreate(
7070
string $imageId,
7171
array $attributes = null
7272
) {
73-
if ($this->previewRegistry->getIsPreview()) {
73+
if ($this->previewRegistry->isPreview()) {
7474
$this->appState->emulateAreaCode(
7575
$this->previewRegistry->getPreviewArea(),
7676
[$this, 'loadDesignConfig']

0 commit comments

Comments
 (0)