From 2a31ba40733ce2109c6173e59a8d915e36fa3984 Mon Sep 17 00:00:00 2001 From: Adam Prost Date: Wed, 22 Aug 2018 13:55:21 -0500 Subject: [PATCH] Ensure that both the layout and page layout have been cached before accessing --- .../Magento/Framework/View/Model/Layout/Merge.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/internal/Magento/Framework/View/Model/Layout/Merge.php b/lib/internal/Magento/Framework/View/Model/Layout/Merge.php index 5be878720620b..10651ea7d3160 100644 --- a/lib/internal/Magento/Framework/View/Model/Layout/Merge.php +++ b/lib/internal/Magento/Framework/View/Model/Layout/Merge.php @@ -427,10 +427,13 @@ public function load($handles = []) $cacheId = $this->getCacheId(); $cacheIdPageLayout = $cacheId . '_' . self::PAGE_LAYOUT_CACHE_SUFFIX; - $result = $this->_loadCache($cacheId); - if ($result) { - $this->addUpdate($result); - $this->pageLayout = $this->_loadCache($cacheIdPageLayout); + + $layoutCache = $this->_loadCache($cacheId); + $pageLayoutCache = $this->_loadCache($cacheIdPageLayout); + + if ($layoutCache && $pageLayoutCache) { + $this->addUpdate($layoutCache); + $this->pageLayout = $pageLayoutCache; foreach ($this->getHandles() as $handle) { $this->allHandles[$handle] = $this->handleProcessed; }