From 336713bb28e52283acd31f418b07f3e5fde00f98 Mon Sep 17 00:00:00 2001 From: "Mr. Integrator" Date: Wed, 27 Jun 2018 09:12:41 -0400 Subject: [PATCH 1/2] magento2 issue #6942 added check for page layout loaded from cache (2.1-develop) --- .../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 3ba43f7142e82..7d88b71aceefe 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/View/Layout/MergeTest.php +++ b/dev/tests/integration/testsuite/Magento/Framework/View/Layout/MergeTest.php @@ -273,7 +273,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 5be878720620b..fbaec0950e4c3 100644 --- a/lib/internal/Magento/Framework/View/Model/Layout/Merge.php +++ b/lib/internal/Magento/Framework/View/Model/Layout/Merge.php @@ -428,9 +428,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; foreach ($this->getHandles() as $handle) { $this->allHandles[$handle] = $this->handleProcessed; } From 1e27a0f46acb8d038be4370b31057c90fa2c86ce Mon Sep 17 00:00:00 2001 From: "Mr. Integrator" Date: Wed, 27 Jun 2018 09:17:50 -0400 Subject: [PATCH 2/2] magento2 issue #6942 fixed integration test (2.2-develop) --- .../testsuite/Magento/Framework/View/Layout/MergeTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 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 7d88b71aceefe..4a29c3e3f3de6 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/View/Layout/MergeTest.php +++ b/dev/tests/integration/testsuite/Magento/Framework/View/Layout/MergeTest.php @@ -275,10 +275,10 @@ public function testLoadCache() $this->assertEquals($handles, $this->_model->getHandles()); $expectedResult = << - + - + XML;