From 879383ddc0d4a0998ec9b20356044fdf5484725b Mon Sep 17 00:00:00 2001 From: "Mr. Integrator" Date: Wed, 27 Jun 2018 11:21:18 -0400 Subject: [PATCH] magento2 issue #6942 added check for page layout loaded from cache --- .../Magento/Framework/View/Layout/MergeTest.php | 11 ++++++++++- .../Magento/Framework/View/Model/Layout/Merge.php | 5 +++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/dev/tests/integration/testsuite/Magento/Framework/View/Layout/MergeTest.php b/dev/tests/integration/testsuite/Magento/Framework/View/Layout/MergeTest.php index d18e38f6ad2a0..115b262216066 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/View/Layout/MergeTest.php +++ b/dev/tests/integration/testsuite/Magento/Framework/View/Layout/MergeTest.php @@ -272,7 +272,16 @@ public function testLoadCache() $handles = ['fixture_handle_one', 'fixture_handle_two']; $this->_model->load($handles); $this->assertEquals($handles, $this->_model->getHandles()); - $this->assertEquals(self::FIXTURE_LAYOUT_XML, $this->_model->asString()); + $expectedResult = << + + + + + + +XML; + $this->assertEquals($expectedResult, $this->_model->asString()); } public function testLoadDbApp() diff --git a/lib/internal/Magento/Framework/View/Model/Layout/Merge.php b/lib/internal/Magento/Framework/View/Model/Layout/Merge.php index 8148b0e8c019f..5b4cbd74abd09 100644 --- a/lib/internal/Magento/Framework/View/Model/Layout/Merge.php +++ b/lib/internal/Magento/Framework/View/Model/Layout/Merge.php @@ -424,9 +424,10 @@ public function load($handles = []) $cacheId = $this->getCacheId(); $cacheIdPageLayout = $cacheId . '_' . self::PAGE_LAYOUT_CACHE_SUFFIX; $result = $this->_loadCache($cacheId); - if ($result) { + $pageLayoutResult = $this->_loadCache($cacheIdPageLayout); + if ($result && $pageLayoutResult) { $this->addUpdate($result); - $this->pageLayout = $this->_loadCache($cacheIdPageLayout); + $this->pageLayout = $pageLayoutResult; return $this; }