Skip to content

Commit 3e7471f

Browse files
committed
MC-34254: If disable module PageBuilder then in the product page, page white
1 parent c1d2eb8 commit 3e7471f

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

lib/internal/Magento/Framework/View/Page/Builder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ public function __construct(
5050
parent::__construct($layout, $request, $eventManager);
5151
$this->pageConfig = $pageConfig;
5252
$this->pageLayoutReader = $pageLayoutReader;
53-
$this->pageConfig->setBuilder($this);
5453
$this->pageLayoutBuilder = $pageLayoutBuilder ?? ObjectManager::getInstance()->get(BuilderInterface::class);
54+
$this->pageConfig->setBuilder($this);
5555
}
5656

5757
/**

lib/internal/Magento/Framework/View/Test/Unit/Page/BuilderTest.php

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@
88
namespace Magento\Framework\View\Test\Unit\Page;
99

1010
use Magento\Framework\View\Layout\Reader\Context;
11+
use Magento\Framework\View\Model\PageLayout\Config\BuilderInterface;
1112
use Magento\Framework\View\Page\Builder;
1213
use Magento\Framework\View\Page\Config;
1314
use Magento\Framework\View\Page\Layout\Reader;
15+
use Magento\Framework\View\PageLayout\Config as PageLayoutConfig;
1416
use PHPUnit\Framework\MockObject\MockObject;
1517

1618
/**
@@ -22,7 +24,7 @@ class BuilderTest extends \Magento\Framework\View\Test\Unit\Layout\BuilderTest
2224

2325
/**
2426
* @param array $arguments
25-
* @return \Magento\Framework\View\Page\Builder
27+
* @return \Magento\Framework\View\Layout\Builder
2628
*/
2729
protected function getBuilder($arguments)
2830
{
@@ -39,6 +41,15 @@ protected function getBuilder($arguments)
3941

4042
$arguments['pageLayoutReader'] = $this->createMock(Reader::class);
4143
$arguments['pageLayoutReader']->expects($this->once())->method('read')->with($readerContext, 'test_layout');
44+
$pageLayoutConfig = $this->createMock(PageLayoutConfig::class);
45+
$arguments['pageLayoutBuilder'] = $this->getMockForAbstractClass(BuilderInterface::class);
46+
$arguments['pageLayoutBuilder']->expects($this->once())
47+
->method('getPageLayoutsConfig')
48+
->willReturn($pageLayoutConfig);
49+
$pageLayoutConfig->expects($this->once())
50+
->method('hasPageLayout')
51+
->with('test_layout')
52+
->willReturn(true);
4253

4354
return parent::getBuilder($arguments);
4455
}

0 commit comments

Comments
 (0)